| Age | Commit message (Collapse) | Author | Files |
|
fix(ui2): ensure msg window is visible after closing tab
Problem: After closing a tabpage while the msg window is showing a
message, it is hidden while the msg window still contains a
message.
Solution: Unhide the msg window after entering a tabpage and it still
contains a message.
(cherry picked from commit 607fcfb37acd78b0e26c35acb463093957d94c45)
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
Co-authored-by: Linykq <yukunlin590@gmail.com>
|
|
Problem: :restart leads to ERR/WRN logging on Windows with --listen.
Solution: Add a log_level flag to vim._with() and use it to suppress
logging from serverstart()/serverstop() during restart.
(cherry picked from commit 208951cbc0ccf05b78edbaa10cfa00175e84f864)
|
|
Problem:
In the default 'titlestring', if the containing directory is the CWD, it renders as "."
Solution:
Add `:p` to the titlestring.
(cherry picked from commit e68e76935267afbf84bff9fffa69f963ebce0f5a)
|
|
Problem:
On Windows, :restart cannot immediately reuse the canonical --listen
address because named pipe release is asynchronous.
Solution:
Start the new Nvim server on a temporary address; in the new Nvim,
retry serverstart() with the original ("canonical") address until it
succeeds.
(cherry picked from commit 5891f2f3dc41eda44c0072d726cf95e54aba85ad)
Co-authored-by: Sanzhar Kuandyk <92693103+SanzharKuandyk@users.noreply.github.com>
|
|
Problem:
With GIT_DIR/GIT_WORK_TREE set, the LSP on the vim.pack.update()
confirmation buffer does not show the correct git log on hover.
Solution:
Temporarily remove the git vars from the environment.
(cherry picked from commit e53e728c925641397bc25969457db67189a2eb75)
|
|
|
|
Problem: Invalid check for non-typed key to dismiss expanded cmdline.
Unable to delay the timer that removes a message from the msg
window.
Solution: Check for empty string instead of nil to determine whether a
key is typed.
Restart the timer if it expires while the user is in the msg
window. Allow entering the msg window with a mouse click.
(cherry picked from commit faa7c15b5a711435ed9d90f7fbf2a2ff8f1255c7)
|
|
|
|
Problem: fg_indexed/bg_indexed were dropped from nvim_get_hl output due
to a wrong short_keys guard. HL_FG_INDEXED also wasn't cleared in
hl_blend_attrs, and HLATTRS_DICT_SIZE was too small.
Solution: Remove the short_keys guard, clear HL_FG_INDEXED in
hl_blend_attrs, bump HLATTRS_DICT_SIZE to 24, and clarify docs that
these flags mean rgb is an approximation of the cterm palette index.
(cherry picked from commit 01861c2f955119cc88158273e100b3490c3df6e1)
Co-authored-by: glepnir <glephunter@gmail.com>
|
|
docs: misc
(cherry picked from commit 54398c587473c0f1d96b601a281477e184865401)
|
|
Problem:
After on_refresh() sends a textDocument/codeLens request, the buffer may
be deleted before the response arrives. The response callback then tries
to redraw that deleted buffer and raises Invalid buffer id error.
Solution:
Check buffer validity before redrawing.
AI-assisted: Codex
Co-authored-by: Yi Ming <ofseed@foxmail.com>
(cherry picked from commit 97caa88972c767122d18034f7462ed8b923b5fe0)
|
|
Problem: completionItem/resolve response's `detail` field is silently
dropped. Only `documentation` is shown in the popup.
Solution: Prepend `detail` as a fenced code block before `documentation`
in the info popup, skipping if documentation already contains it.
(cherry picked from commit b351afb1b1c564c5a4e6856764d4db21a873242c)
|
|
Problem:
No LuaLS types for event-data fields (ev.data). Types are only
documented ad hoc in scattered locations.
Solution:
Add runtime/lua/vim/_meta/events.lua defining vim.event.<name>.data
classes for events that provide ev.data. Reference the types from
each event's help in autocmd.txt, lsp.txt, and pack.txt.
(cherry picked from commit 2cb240319b61eb98abcaae08b3c0a6d98fce53ac)
|
|
Problem: Using `buf=0`/`win=0` context in `vim._with` should be
equivalent to using explicit buffer/window identifier respectively.
Solution: Explicitly adjust context in case of `buf=0` or `win=0`.
(cherry picked from commit 3a4cc5db0b8eb1d825a2a57d177853e1b4c90e28)
|
|
Problem: Calling `vim.filetype.match({ filename = '...', buf = ... })`
during startup results in an error due to not yet defined
`g:ft_ignore_pat`.
Solution: Add a guard to check `g:ft_ignore_pat` related properties only
if the variable is defined. This also allows to simplify other tests
which did not depend on `g:ft_ignore_pat` but required it explicitly
set to work.
(cherry picked from commit 6b9b4a1377b330fca651287025c1bf5242ac9790)
|
|
Problem: Documentation based on patches is outdated.
Solution: Add changes to documentation in a patch.
https://github.com/vim/vim/commit/853886722c051ecaef6d818ce32a822e4f43dc2b
Trailing space was removed in later patches.
Also fix a few more misplaced error numbers from #8155.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 39410ef42ba3bd5c4db5fa3f944b5abca935d3dc)
|
|
Problem: Sometimes automatic lockfile synchronization after `:restart`
might fail, like due to bad/absent Internet connection. This would
remove failed to install entries from the lockfile (since they are not
on disk and lockfile is meant to lock the latest plugin version on
disk).
Solution: Document that this should be treated as an unwanted update and
use steps similar to "Revert plugin after an update" use case.
(cherry picked from commit 42e9d8dfd1056e99713cb3f8a0155d1555cf896d)
|
|
Problem:
`TSNode:id()` returns the underlying c pointer as a string, which may include
NUL bytes. In PUC Lua, `('%s'):format('\0a\0')` returns `''` and not `'\0a\0'`
(i.e. treats the string as a c-string (which terminates at the NUL byte)).
This resulted in two different nodes being able to have the same id.
Solution:
Use concatenation `..` instead of `string.format()`.
(cherry picked from commit bb2284d75e7e2b0587610d1ae4d681d185622645)
|
|
Problem: - Paging keys in the dialog window consume input when the user
may not expect it. The dismissable title hint intended to
mitigate that results in having to press Escape twice to
abandon the prompt.
- Mimicked "msgsep" float border is taking up unnecessary
space when window takes up the entire screen.
Solution: - Use (conventional, albeit less convenient) keys intended
for scrolling to page the dialog window:
<(Mousewheel/Page)Up/Down>, <Home/End>.
- Only set the float top border when separation is actually
necessary, i.e. window does not reach the first row.
(cherry picked from commit f0a8e6f3377c5393859c85cd44c1d2c57e8fe2d2)
|
|
test: lint naming conventions
Problem:
Naming conventions are not automatically checked.
Solution:
Add a check to the doc generator. Eventually we should extract this
somehow, but that will require refactoring the doc generator...
Note: this also checks non-public functions, basically anything that
passes through `gen_eval_files.lua` and `gen_vimdoc.lua`. And that's
a good thing.
|
|
Problem
Some variables use the wrong type (ClientToServer instead of ServerToClient)
and some use vaguer types that could be more strict.
Solution
Use the correct types.
(cherry picked from commit 530cfa1323cea6b392b1b4c8e643f324b166f89e)
|
|
|
|
|
|
continues d0af4cd9094f.
This commit renames positional parameters. This is only "cosmetic", but
is intended to make it extra clear which name is preferred, since people
often copy existing code despite the guidelines in `:help dev-naming`.
(cherry picked from commit 71ac4db335e00b03b27d2c4aa5ab90c083a3a3e7)
|
|
Replace the busted-based Lua test runner with a repo-local harness.
The new harness runs spec files directly under `nvim -ll`, ships its own
reporter and lightweight `luassert` shim, and keeps the helper/preload
flow used by the functional and unit test suites.
Keep the file boundary model shallow and busted-like by restoring `_G`,
`package.loaded`, `package.preload`, `arg`, and the process environment
between files, without carrying extra reset APIs or custom assertion
machinery.
Update the build and test entrypoints to use the new runner, add
black-box coverage for the harness itself, and drop the bundled
busted/luacheck dependency path.
AI-assisted: Codex
(cherry picked from commit 55f9c2136e52d8719495b6021ce7e8d64c5141fe)
|
|
AI-assisted: Codex
(cherry picked from commit e289f9579c73b4f6da105dfad87bd90e0dc6d973)
|
|
In 3a4a66017b74, 4d3a67cd6201, df8d98173cbc we renamed "buffer" to "buf"
in dict parameters and return-values.
This commit renames positional parameters. This is only "cosmetic", but
is intended to make it extra clear which name is preferred, since people
often copy existing code despite the guidelines in `:help dev-naming`.
(cherry picked from commit d0af4cd9094f3439382622906da5b1c5cd82c294)
|
|
- revert bogus change to `_meta/builtin_types.lua` from 3a4a66017b74
Co-authored-by: David Mejorado <david.mejorado@gmail.com>
|
|
Problem:
- Not obvious which _meta/ are generated and which should be edited
manually.
- The require guard (`error('Cannot require a meta file')`) is not
consistently present in all meta files.
Solution:
- Update headers.
- Add require() guard to all meta files.
- Rename generated meta files with `.gen.lua`.
(cherry picked from commit 65b40e69acbcb28c0e7ef9228f731c444a788e93)
|
|
Problem:
- Lots of redundant text in options docs for "not allowed in
a modeline", even though we already have a flag that indicates that.
- `deny_in_modelines` is an old vestigial flag only used by 'encoding'
(which never changes).
Solution:
- Generate docs based on the `secure` flag.
- Remove the `deny_in_modelines` flag (`kOptFlagNoML`).
(cherry picked from commit 829e9ec65e37588ee1b8329a42b2c31b33b599bf)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
|
In 3a4a66017b74192caaf9af9af172bdc08e0c1608, 4d3a67cd620152d11ab9b5f5bdd973f84cc2d44b
we renamed "buffer" to "buf" in dict parameters.
This commit also renames such keys in dict return-values.
|
|
revert eb90f5d9e3a6615870f9bf0b28e30f6e84ccd6f4
(cherry picked from commit 4eb95c8ed23864d101ee23a41ce52e27b7b4393e)
|
|
Problem: vim.lsp.util.show_document insert mode is unable
to set the cursor after the target character position if the target character
is at end of line.
Solution: Move cursor after the target character (in append position)
in this case.
(cherry picked from commit 891bb0e6ce513dc885cebe995918e5db4e69174a)
|
|
Problem: _get_and_set_name edits the name for the whole group,
thus only one client per group gets the didOpen message.
Solution: move the logic to _changetracking and loop over every
client per group.
(cherry picked from commit 37eb1b99792c81c5f437e6d5a2fbb8dfba7c1472)
|
|
|
|
|
|
Problem: hlgroup2dict passes &ns_id to ns_get_hl twice. The first call
(link=true) sets *ns_hl = 0 when link_global is set, so the second call
and the sg_cleared guard both see ns_id == 0 and bail out. The group is
silently dropped from the result.
Solution: use a temporary copy of ns_id for each ns_get_hl call so the
original value is preserved.
(cherry picked from commit 49086862fc521c29dd8fb7c96cc23a267f1bf397)
|
|
Problem:
If `'keywordprg'` begins with `:`, `3K` turns the count into an Ex
range. Commands that don't support that then fail. Vim passes the count
as the first arg (see #19436, vim/vim#10745).
Solution:
Pass `[count]` as the first arg for `'keywordprg'`.
(cherry picked from commit 6e95d1ad138cb25e04ef98c95f93d1a7af8c1f49)
|
|
Problem:
On Git versions 2.13..2.26 there is a bug that prevents using
`stash --message`.
Solution:
Use the full `stash push --message` form to avoid that bug.
(cherry picked from commit 38aec2d3cdd317231e6e89ef5a9a51ebdda757b7)
|
|
Problem: hover/signature callback lacked consistency checks, so slow LSP servers
could open a float after the cursor had already moved away.
Solution: guard the callback with buf validity, buf version, and cursor
position checks before opening the float. Also fix table capacity calculation.
(cherry picked from commit af9a72d8c105129bb107ee0bc9a38ade44caf7b6)
|
|
Problem: If the lockfile points to the revision that is not on disk, the
`:checkhealth vim.pack` suggests to run `vim.pack.update()`. Although
usually it should resolve the problem, it is not always the case: like
if the state on disk is already the latest available.
Solution: Add an extra suggestion with a more drastic measure by
manually removing `rev` field from the lockfile for it to be repaired
after the `:restart`.
(cherry picked from commit 94c0e54e5b93049274031a0bc59c831ad40db201)
|
|
new() only supports nargs=5 or nargs=2, but this was passing 4 args.
(cherry picked from commit 24811c0a1410703d78e77c6a3233ff85f87964ef)
|
|
For now, add a private "_truncate" flag to nvim_echo, using a truncation
method similar to showmode().
(cherry picked from commit 9c5fba5df0b60cd25ac2c180a7d82fca47a105e6)
|
|
feat(api): rename buffer to buf
Problem:
`:help dev-name-common` states that "buf" should be used instead of
"buffer" but there are cases where buffer is mentioned in the lua API.
Solution:
- Rename occurrences of "buffer" to "buf" for consistency with the
documentation.
- Support (but deprecate) "buffer" for backwards compatibility.
Co-authored-by: Jordan <46637683+JordanllHarper@users.noreply.github.com>
|
|
Problem: nvim_exec_autocmds() documentation incorrectly describes the default
for "pattern" as *, when it's actually the current file name (like :doautocmd).
Solution: correct it. Add a test.
|
|
|
|
Problem:
Since 2f6d1d3c887a87d9402137425b418dd12a904aac, `apply_text_edits`
unconditionally sets `buflisted=true`, causing spurious BufDelete events
if plugins restore the original 'buflisted' state on unlisted buffers:
https://github.com/neovim/neovim/blob/65ef6cec1cb766334c59d3255595dfe523b11020/src/nvim/option.c#L2159-L2169
Solution:
- Don't set 'buflisted' in `apply_text_edits`. Set it more narrowly, in
`apply_workspace_edit` where the semantics requires affected buffers
to be visible to the user.
- Also skip setting 'buflisted' if it would not be changed, to avoid
redundant `OptionSet` events.
(cherry picked from commit 6473d007e7b9f7f14b06190117f0bb0269fa938c)
|
|
- `_get_known_filetypes` may be useful for other internal code, so move
it to an internal function.
- Use a set instead of a list, for performance.
|
|
Problem: vim.VersionRange had no __eq metamethod, so comparing 2 distinct
but same value instances always returned false. In vim.pack.add this caused
redundant lockfile rewrites, even when the resulting lockfile content was
unchanged.
Solution: Add __eq metamethod on vim.VersionRange
|
|
fix(health): misleading warnings re filetypes registered w/ vim.filetype.add() #38867
Problem:
`:checkhealth vim.lsp` validates configured filetypes against
`getcompletion('', 'filetype')`. This only reflects runtime support
files.
This causes false warnings in `:checkhealth vim.lsp` for configured
filetypes that are known to the Lua filetype registry, including
values added with `vim.filetype.add()` and built-in registry-only
filetypes.
Solution:
Build the healthcheck's known-filetype set from both
`getcompletion('', 'filetype')` and `vim.filetype.inspect()`.
(cherry picked from commit 20a3254ad42dfb08faad275c1c79764de8e24c69)
Co-authored-by: Barrett Ruth <62671086+barrettruth@users.noreply.github.com>
|