* build(contrib): add zsh completion
this is not part of the build system yet, so packager managers are
supposed to install the file by themselves.
bash doesn't seem to provide shell completion, zsh embeds its own
completion that is bundled with vim's.
Instead of copying zsh's completion, this generated one via
https://github.com/RobSis/zsh-completion-generator
---------
Co-authored-by: Eisuke Kawashima <e.kawaschima+github@gmail.com>
Problem: `trigger` is a custom word not yet used in APIs.
Solution: Use `get` instead because the main effect is that the
completion candidates will be collected (and shown by default,
but follow-up commits are planned to add an `on_result` callback
that allows more general handling).
---------
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Problem: :checkhealth fails if plugin has nested "lua/" directory
Solution: trim `{runtimepath}/lua` from fullpath to get subpath
(`./**/{health, health/init.lua}`)
Problem:
The `lua/` tests dir is for Lua stdlib tests. It is not for anything
that randomly happens to be implemented with Lua.
Solution:
Move `lua/runtime_spec.lua` to `editor/runtime_spec.lua`.
Problem: Marks that go beyond the end of the buffer, and paired marks
whose end is in front of its start mark are added to and
removed from the decor. This results in incorrect tracking
of the signcolumn.
Solution: Ensure such marks are not added to and removed from the decor.
Problem:
- Many other ftplugin have defined 'omnifunc', but the Lua one doesn't
define one, even though there is `vim.lua_omnifunc()`
- Users may want "stupid" completion to fix Lua config with
`nvim --clean` in case they breaks it
- Nvim doesn't port Lua foldexpr from Vim
Solution:
- Set 'omnifunc' to 'v:lua.vim.lua_omnifunc' in ftplugin/lua.lua
- Set 'foldexpr' to use treesitter
Problem:
`feed_command()` was added as a "bridge" for old test code. 99% of those
cases should be using `n.command()`, which raises errors instead of
silently continuing the test.
Solution:
Deprecate `feed_command()`. It should not be used in new tests.
All usages of `feed_command()` should be converted to `command()` or
`feed()`.
Problem: Virtual 'statuscolumn' lines are evaluated with a misleading v:(rel)num.
Namely set to the line above for `virt_lines_above = true` lines, or even
the last drawn line for a partial redraw.
Solution: Set `v:lnum` for the first evaluated row of a line, first above
virtual line of a row and first non-virtual line of a row.
Problem: Augroup to close lsp preview hover window is not cleared after
the window is closed because of unmatched group name.
Solution: Delete the augroup before closing the preview window with
correct group name.
Problem: No block events emitted with ext_cmdline for :if, :while, :try etc.
Solution: Emit cmdline block events; store the indent level of the
previous cmdline and whether a block event was emitted.
Problem: tests: test_filetype fails when a file is a directory
(Eisuke Kawashima)
Solution: When encountering a directory instead of a file, skip that
particular filetype test
fixes: vim/vim#1689463a885b650
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: completion: preinserted text not removed when closing pum
Solution: delete preinsert text inside in ins_compl_stop() (glepnir).
closes: vim/vim#1689184a7503e29
Problem: MS-Windows: crash when passing long string to expand() with
'wildignorecase'.
Solution: Use the same buflen as unix_expandpath() in dos_expandpath().
Remove an unnecessary STRLEN() while at it (zeertzjq).
closes: vim/vim#1689600a749bd90
Problem: matchparen keeps cursor on case label in sh filetype
(@categorical, after 9.1.1187).
Solution: Use :defer so that cursor is always restored, remove checks
for older Vims, finish early if Vim does not support :defer
fixes: vim/vim#16887closes: vim/vim#1688847071c6076
Problem: Buffer overflow when expanding long file name.
Solution: Use a larger buffer and avoid overflowing it. (Yee Cheng Chin,
closesvim/vim#12201)
a77670726e
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Problem:
Test may fail because it matches a Lua table address, and the following
whitespace may differ depending on the stringified address length:
test/functional/lua/loop_spec.lua:233: Row 3 did not match.
Expected:
|{3: }|
|{9:Error executing callback:} |
|*{9:uv_idle_t: 0x{MATCH:%w+}} |
|{6:Press ENTER or type command to continue}^ |
Actual:
|{3: }|
|{9:Error executing callback:} |
|*{9:uv_idle_t: 0xd4c2820a00} |
|{6:Press ENTER or type command to continue}^ |
Solution:
Match a variable amount of whitespace.
Problem:
Given that `vim.snippet.expand()` sets temporary `<tab>`/`<s-tab>`
keymaps there is no way to build "smart-tab" functionality where `<tab>`
chooses the next completion candidate if the popup menu is visible.
Solution:
Set the keymap permanent in `_defaults`.
The downside of this approach is that users of multiple snippet engine's
need to adapt their keymaps to handle all their engines that are in use.
For example:
vim.keymap.set({ 'i', 's' }, "<Tab>", function()
if foreign_snippet.active() then
return "<Cmd>lua require('foreign_snippet').jump()<CR>"
elseif vim.snippet.active({ direction = 1 }) then
return "<Cmd>lua vim.snippet.jump(1)<CR>"
else
return key
end
end, { expr = true })
Upside is that using `vim.keymap.set` to override keymaps is a well
established pattern and `vim.snippet.expand` calls made by nvim itself
or plugins have working keymaps out of the box.
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Problem: Cmdline pum not cleared for input() completion.
Solution: Temporary reset RedrawingDisabled in cmdline_pum_cleanup(),
like what is done in wildmenu_cleanup() (zeertzjq).
fixes: vim/vim#16874closes: vim/vim#168761830e787f6
No code change is needed in Nvim, as RedrawingDisabled does not prevent
the compositor from removing a grid.
Problem: Various list commands end in a newline to go to a new line on
the message grid for the prompt message, which is unwanted
with ext_messages.
Solution: Don't emit a trailing newline with ext_messages for
inputlist(), :tselect and z=.
Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
Problem: yi' don't highlight last character since
8ce504820a.
Solution: Always use `opts.inclusive=true`, since calculation of `"]`
(`b_op_end`) have taken `inclusive` into account.
Problem: inside try-block: fn body executed when default arg is
undefined
Solution: When inside a try-block do not execute function body after an
error in evaluating a default argument expression
(Shane Harper).
closes: vim/vim#168652d18789aa6
Co-authored-by: Shane Harper <shane@shaneharper.net>
"umask" is pronounce like "youmask", so having an "an" before it is a
bit strange. In other places in the help, "umask" is not preceded by
either "a" or "an", and sometimes preceded by "the".
Also, "Note" is usually followed either by ":" or "that" in builtin.txt,
so add a ":" after "Note".
closes: 16860
c1c3b5d6a0
Problem:
Nvim tries to use OSC 52 even when no TUIs are attached.
Solution:
On each UIEnter/UILeave event, check that there is a TUI client connected to Nvim's stdout.
Problem:
On Windows, the first attempt at finishing up after a terminal process
terminates is delayed by 200ms, even if it would be possible to finish
up immediately.
Solution:
Make the first attempt at finishing up immediately after the process
terminates.