Problem:
tagfunc failed in a weird buffer (either a directory or some other
non-file buffer, I don't remember):
E987: Invalid return value from tagfunc
E5108: Error executing lua …/runtime/lua/vim/lsp/util.lua:311: EISDIR: illegal operation on a directory
stack traceback:
at this line:
local data = assert(uv.fs_read(fd, stat.size, 0))
Solution:
Check for directory.
Problem: [security]: use-after-free when closing a buffer
Solution: When splitting the window and editing a new buffer,
check whether the newly to be edited buffer has been marked
for deletion and abort in this case
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-rj48-v4mq-j4vg51b62387be
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: 'cedit', 'termwinkey' and 'wildchar' may not be parsed
correctly
Solution: improve string_to_key() function in option.c
(Milly)
- Problem: `^@` raises an error.
Solution: Store as `<Nul>`.
- Problem: `<t_xx` does not raise an error.
Solution: Raise an error if closing `>` is missing.
- Problem: Single `<` or `^` raises an error. It is inconvenient for users.
Solution: They are stored as a single character.
closes: vim/vim#15811a9c6f90918
Co-authored-by: Milly <milly.ca@gmail.com>
Problem: :cd completion fails on Windows with backslash in path
Solution: switch no_bslash argument to FALSE in file_pat_to_reg_pat()
Note: only fixes the problem on Windows. For Unix, we still need to
escape backslashes since those are taken as regex atoms (and could be
invalid regex atoms).
fixes: vim/vim#15643closes: vim/vim#158081a31c430bb
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem:
- Some servers like LuaLS add unwanted blank lines after multiline
`@param` description.
- List items do not wrap nicely.
Solution:
- When rendering the LSP doc hover, remove blank lines in each `@param`
or `@return`.
- But ensure exactly one empty line before each.
- Set 'breakindent'.
The current LspAttach example shows setting options which are already
set by default. We should expect that users are going to copy-paste
these examples, so we shouldn't use examples that are superfluous and
unnecessary.
Problem: `runtime/tools/emoji_list.vim` is a Lua script masquerading as
Vimscript, which is unnecessary now that `:source` works for Lua files.
Solution: Remove Vimscript wrapper.
Problem:
Index for global and numbered marks out of bounds when indexing into
numbered marks array (contains 10 elements but indexed by values 26 through 35.
Solution:
Offset index by number of global marks to correctly index numbered marks array.
Problem: Cannot build against Ruby 33 dynamically
Solution: Ruby 33 removed transient heap, so do not use
rb_ary_transient anymore, NoMethodError format changed,
so update test for expected error message
(Isao Sato)
- ruby-3.3 removed transient heap for ruby/dyn
when +ruby/dyn with ruby-3.3 do command :ruby, E448 occur.
ruby-3.3 has no transient heap anymore, so disable rb_ary_transient etc.
$ LC_ALL=C VIMRUNTIME=runtime ./src/vim -u NONE -c 'ruby puts RUBY_VERSION'
"=> Error detected while processing command line:
"=> E448: Could not load library function rb_ary_detransient
"=> E266: Sorry, this command is disabled, the Ruby library could not be
loaded.
- ruby-3.3 changed NoMethodError format:
$ rvm 3.2.2, 3.3.0-rc1 do ruby -e 'begin; nil.name; rescue => e; puts "%s : %s"%[RUBY_VERSION, e.message]; end '
=> 3.2.2 : undefined method `name' for nil:NilClass
=> 3.3.0 : undefined method `name' for nil
so loose pattern in Test_ruby_Vim_buffer_get()
closes: vim/vim#13741443657b32b
Co-authored-by: Isao Sato <svardew@gmail.com>
Problem: screenpos() may return invalid position
after switching buffers (Greg Hurrell)
Solution: reset w_leftcol if wrapping has been set
after copying wrap option
fixes: vim/vim#15792closes: vim/vim#15803b065a10e24
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem:
There appears to be an intentional array out of bounds read when
indexing global and numbered marks since they are adjacent in the struct
that holds them.
Solution:
Explicitly index numeric marks array to avoid reading out of bounds from
global marks array.
With "g:markdown_fenced_languages" defined and "java" added
to its list, a circular dependency between the Markdown and
Java syntax files will be made. To break it, no Markdown
documentation comments will be recognised in fenced blocks
in Markdown files; in order to view Java source files,
"java" must be removed from "g:markdown_fenced_languages",
and this task can be automated as follows.
1) Add to "~/.after/ftplugin/java.vim":
------------------------------------------------------------
if exists("g:markdown_fenced_languages") &&
\ !(exists("g:java_ignore_javadoc") ||
\ exists("g:java_ignore_markdown"))
let s:idx = index(g:markdown_fenced_languages, 'java')
if s:idx > -1
call remove(g:markdown_fenced_languages, s:idx)
endif
unlet s:idx
endif
------------------------------------------------------------
2) Optionally add to "~/.after/ftplugin/markdown.vim":
------------------------------------------------------------
if exists("g:markdown_fenced_languages") &&
\ index(g:markdown_fenced_languages, 'java') < 0
call add(g:markdown_fenced_languages, 'java')
endif
------------------------------------------------------------
(Make sure that the above snippets appear in the files under
the "ftplugin" NOT "syntax" directory.)
Finally, unless the new version of the syntax file is made
available from "$VIMRUNTIME" (and from "~/.vim/syntax" if
necessary), OTHER discoverable file versions will be used
whose behaviour may interfere with this fix.
related: vim/vim#15740closes: vim/vim#1579660310a4b26
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Problem: it's possible to set an invalid key to 'wildcharm'
Solution: error out, if the 'wildcharm' value is an invalid key
(Milly)
closes: vim/vim#1578740c6babc17
Co-authored-by: Milly <milly.ca@gmail.com>
Some commands don't accept "count" and only work with "range". It's not
clear why. The issue is tracked at [1], but this is a workaround for
now.
[1]: https://github.com/neovim/neovim/issues/30641
Problem: Lua accessors for
- global, local, and special variables (`vim.{g,t,w,b,v}.*`), and
- options (`vim.{o,bo,wo,opt,opt_local,opt_global}.*`),
do not have command-line completion, unlike their vimscript counterparts
(e.g., `g:`, `b:`, `:set`, `:setlocal`, `:call <fn>`, etc.).
Completion for vimscript functions (`vim.fn.*`) is incomplete and does
not list all the available functions.
Solution: Implement completion for vimscript function, variable and
option accessors in `vim._expand_pat` through:
- `getcompletion()` for variable and vimscript function accessors, and
- `nvim_get_all_options_info()` for option accessors.
Note/Remark:
- Short names for options are yet to be implemented.
- Completions for accessors with handles (e.g. `vim.b[0]`, `vim.wo[0]`)
are also yet to be implemented, and are left as future work, which
involves some refactoring of options.
- For performance reasons, we may want to introduce caching for
completing options, but this is not considered at this time since the
number of the available options is not very big (only ~350) and Lua
completion for option accessors appears to be pretty fast.
- Can we have a more "general" framework for customizing completions?
In the future, we may want to improve the implementation by moving the
core logic for generating completion candidates to each accessor (or
its metatable) or through some central interface, rather than writing
all the accessor-specific completion implementations in a single
function: `vim._expand_pat`.
An implication of this current approach is that `NVIM_API_LEVEL` should be
bumped when a new Lua function is added.
TODO(future): add a lint check which requires `@since` on all new functions.
ref #25416
**Problem:** The documentation for `TSNode` and `TSTree` methods is
incomplete from the LSP perspective. This is because they are written
directly to the vimdoc, rather than in Lua and generated to vimdoc.
**Solution:** Migrate the docs to Lua and generate them into the vimdoc.
This requires breaking up the `treesitter/_meta.lua` file into a
directory with a few different modules.
This commit also makes the vimdoc generator slightly more robust with
regard to sections that have multiple help tags (e.g. `*one* *two*`)
Some composite/compound types even as basic as `(string|number)[]` are
not currently supported by the luacats LPEG grammar used by gen_vimdoc.
It would be parsed & rendered as just `string|number`.
Changeset adds better support for these types.
Problem:
Tree cursors can only be efficient when they are re-used.
Short-lived cursors are very slow.
Solution:
Reimplement functions that use short-lived cursors.
Problem: quickfix list does not handle hardlinks well
Solution: store original file name with quickfix entry
(Austin Chang)
Quickfix list shows entries with duplicate name if the file is opened
with the path of hard links.
The major cause is that qflist assumed that the filename passed into
`qf_add_entry` matches the filename opened with the buffer.
This patch handles this case by introduce a `qf_fname` into `qfline_S`
structure. It stores the filename from `qf_add_entry` for each quickfix
line.
closes: vim/vim#156872982299699
Co-authored-by: Austin Chang <austin880625@gmail.com>
Ensure the screen is fully updated before blocking for input. This did
not always happen before, for example when setting `cursorline
scrolloff=9999`, which lead to jerky movement when using some GUI
applications.
Because of the duality of redraw_later, this can't be done in
command-line or when waiting for "Press ENTER". In many of those cases
the redraw is expected AFTER the key press, while normally it should
update the screen immediately. So, those special cases are excluded.
Problem: fixed order of items in insert-mode completion menu
Solution: Introduce the 'completeitemalign' option with default
value "abbr,kind,menu" (glepnir).
Adding an new option `completeitemalign` abbr is `cia` to custom
the complete-item order in popupmenu.
closes: vim/vim#14006closes: vim/vim#157606a89c94a9e
Problem:
The `_watch.watch()` strategy may fail if the given path does not exist:
…/vim/_watch.lua:101: ENOENT: no such file or directory
stack traceback:
[C]: in function 'assert'
…/vim/_watch.lua:101: in function <…/vim/_watch.lua:61>
[string "<nvim>"]:5: in main chunk
- `_watch.watch()` actively asserts any error returned by `handle:start()`.
- whereas `_watch.watchdirs()` just ignores the result of `root_handle:start()`.
Servers may send "client/registerCapability" with "workspace/didChangeWatchedFiles"
item(s) (`baseUri`) which do not actually exist on the filesystem:
https://github.com/neovim/neovim/issues/28058#issuecomment-2189929424
{
method = "client/registerCapability",
params = {
registrations = { {
method = "workspace/didChangeWatchedFiles",
registerOptions = {
watchers = { {
globPattern = {
baseUri = "file:///Users/does/not/exist",
pattern = "**/*.{ts,js,mts,mjs,cjs,cts,json,svelte}"
}
},
...
}
Solution:
- Remove the assert in `_watch.watch()`.
- Show a once-only message for both cases.
- More detailed logging is blocked until we have `nvim_log` / `vim.log`.
fix#28058
Problem: can set cedit to an invalid value
Solution: Check that the value is a valid key name
(Milly)
closes: vim/vim#1577825732435c5
Co-authored-by: Milly <milly.ca@gmail.com>