Now nvim_parse_cmd and nvim_create_user_command use a "tab" value which
is the same as the number passed before :tab modifier instead of the
number plus 1, and "tab" value is -1 if :tab modifier is not used.
vim-patch:9.0.0341: mapset() does not restore <Nop> mapping properly
Problem: mapset() does not restore <Nop> mapping properly.
Solution: Use an empty string for <Nop>. (closesvim/vim#11022)
92a3d20682
This introduces the following breaking changes:
- nvim_get_keymap now always returns a LuaRef object as "callback" for a
Lua mapping regardless of how it is called. The LuaRef object can be
called from Lua and Vim script, but is lost over RPC.
- maparg() now returns a Funcref instead of a ref number as "callback"
for a Lua mapping. The Funcref can be called from Lua and Vim script,
but is lost over RPC.
This may also make nvim_get_keymap faster, but make maparg() slower.
Problem: Test for crash fix does not fail without the fix.
Solution: Adjust the test sequence. (closesvim/vim#8506)
3777d6e32b
Cherry-pick CheckUnix from patch 8.2.1432.
`!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false`
is sometimes used to defer exception handling for later (without forgetting the
exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred
to a different call (e.g: when `try_level > 0`).
In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of
`did_throw = false`, but also causes the pending exception to be lost, which
also leaks as `discard_exception()` wasn't used.
It may be possible to fix this by saving/restoring `current_exception`, but
handling all of `did_throw`'s edge cases seems messier. Maybe not worth
diverging over.
This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown
due to Windows missing `man`, but they're lost; skip these tests if `man` isn't
executable.
fix(events): trigger WinScrolled when only skipcol changed
vim-patch:9.0.0304: WinScrolled is not triggered when only skipcol changes
Problem: WinScrolled is not triggered when only skipcol changes.
Solution: Add w_last_skipcol and use it. (closesvim/vim#10998)
670ab0334b
This removes the support for defining links via
vim.treesitter.highlighter.hl_map (never documented, but plugins did
anyway), or the uppercase-only `@FooGroup.Bar` to `FooGroup` rule.
The fallback is now strictly `@foo.bar.lang` to `@foo.bar` to `@foo`,
and casing is irrelevant (as it already was outside of treesitter)
For compatibility, define default links to builting syntax groups
as defined by pre-existing color schemes
Problem: Crash when opening a buffer for the cmdline window fails. (Chris
Barber)
Solution: Check do_ecmd() succeeds. Reset got_int if "q" was used at the
more prompt. (closesvim/vim#6211)
9b7cce28d5
Make code match latest Vim instead.
In non-multigrid UI the only change is that the returned height now
excludes winbar, and this is compatible with Vim.
In multigrid UI this means the return value of these functions now
reflect the space available for buffer lines in a window.
No change in nvim_win_get_height() and nvim_win_get_width().
Problem: Cannot use expand() to get the script name.
Solution: Support expand('<script>'). (closesvim/vim#10121)
6013d0045d
Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Cherry-pick builtin.txt expand() doc from latest Vim.
Problem: Insufficient tests for src/buffer.c.
Solution: Add more tests. Move comments related tests to a separate file.
(Yegappan Lakshmanan, closesvim/vim#6325)
b7e2483655
Problem: Several errors are not tested for.
Solution: Add tests. (Yegappan Lakshmanan, closesvim/vim#5892)
ee4e0c1e9a
Omit Test_range() change: reverted in patch 8.2.0615.
Cherry-pick Test_z_no_space_before_xxx() from patch 8.2.0195.
Cherry-pick Test_reverse_sort_uniq() change from patch 8.2.0183.
Make uniq() error behavior consistent with sort().
Cherry-pick Test_set_ttytype() change from patch 8.1.1826.
Cherry-pick quickfix checks from patch 8.1.2373 to test_preview.vim.
Test_viminfo_error() is applicable.
Cherry-pick E1058 from patch 8.2.0149 and port Test_deep_nest() to Lua.
which is both unexpected and different from the Vim behaviour.
Indent was triggered once by the '!' check in insert_execute(), and
inserting the char was correctly skipped, but then triggered again in
insert_check() (provided that cindent was not being ignored after manual
indentation, i.e. `can_cindent == true`).
While this is the smallest fix, another solution would be to remove
VimState#check and instead move that to *_enter()/-_execute(), since the
control flow is pretty unnecessarily convoluted as is. That would also
have the benefit of differing less from the Vim source code.
Problem: Command line popup menu not positioned correctly.
Solution: Also use vim_strsize() on the existing text. (Naruhiko Nishino,
closesvim/vim#9727)
68cc2b8a37
Problem: 'wildmenu' only shows few matches.
Solution: Add the "pum" option: use a popup menu to show the matches.
(Yegappan Lakshmanan et al., closesvim/vim#9707)
3908ef5017
Omit p_wmnu check in cmdline_pum_active() as it can cause problems.
Omit vim_strchr() flags as that isn't really better than bitmasks.
Omit key translations and document it in vim_diff.txt.
Problem: A command defined with `nargs="?"` returns `fargs={""}` to
a Lua callback when executed with no arguments, which is inconsistent
with how`nargs="*"` behaves.
Solution: Pass `fargs={}` for no argument with `nargs="?"` as well.
Problem: Insufficient testing for reading/writing files.
Solution: Add more tests. (Yegappan Lakshmanan, closesvim/vim#6257)
Add "ui_delay" to test_override() and use it for the CTRL-O test.
b340baed9f
Omit test_override().
Reorder test_writefile.vim to match Vim.
Allows preview callbacks to modify multiple buffers in order to show the
preview. Previously, if multiple buffers were modified, only the current
buffer would have its state restored. After this change, all buffers
have their state restored after preview.
Closes#19103.
These were just added to avoid churn when changing the default
of 'display'. To simplify message handling logic, we might want
to remove support for printing messages in default_grid later on.
This would allow things like printing error messages safely in the
middle of redraw, or a future graduation of the 'multigrid' feature.
Let :wincmd command accept a count like what its documentation suggests.
Previously it could only accept a range, which led to some ambiguity on
which attribute should be used when executing :wincmd using nvim_cmd.
Closes#19662.
Also fix a typo in a related Vim test:
vim-patch:9.0.0223: typo in diffmode test
Problem: Typo in diffmode test.
Solution: Fix the typo. (closesvim/vim#10932)
5fd6ab820b
Problem: The way 'cmdheight' can be made zero is inconsistent.
Solution: Only make 'cmdheight' zero when setting it explicitly, not when
resizing windows. (closesvim/vim#10890)
f797e309ca
Problem: Some Normal mode commands not fully tested.
Solution: Add a few more tests. (Yegappan Lakshmanan, closesvim/vim#7073)
d1ad99b654
Cherry-pick test_registers.vim change from patch 8.2.0644.
Problem: Mode is not cleared when leaving Insert mode with mapped Esc.
Solution: Clear the mode when redraw_cmdline is set. (closesvim/vim#4269)
4c25bd785a
Problem: Peeking and flushing output slows down execution.
Solution: Do not update the mode message when global_busy is set. Do not
flush when only peeking for a character. (Ken Takata)
cb574f4154
Omit inchar() change: it breaks too many tests.
N/A patches for version.c:
vim-patch:8.2.5170: tiny issues
Problem: Tiny issues.
Solution: Tiny improvements.
944cc9ceba
Problem: Ex command error cannot contain an argument.
Solution: Add ex_errmsg() and translate earlier. Use e_trailing_arg where
possible.
8930caaa1a
Remove duplicate test file 062_tab_pages_spec.lua
Test ":unlet self-referencing node in a List graph #6070" feeds many characters into typeahead, so a timeout of only 100 milliseconds sometimes fails. Change that timeout to 1000 milliseconds.
N/A patches for version.c:
vim-patch:9.0.0135: comment about tabpage line above the wrong code
Problem: Comment about tabpage line above the wrong code.
Solution: Move the comment. (closesvim/vim#10836)
0b0ccbbfb0
`:saveas newName` changes the name of an existing buffer.
Due to the buffer re-use it skips the lsp attach phase and immediately
sends a `didSave` notification to the server.
Servers get confused about this, because they expect a `didOpen`
notification first.
Closes https://github.com/neovim/neovim/issues/18688
Problem: maparg() does not provide enough information for mapset().
Solution: Add "lhsraw" and "lhsrawalt" items. Drop "simplified"
9c65253fe7
vim-patch:9.0.0127: unused variable
Problem: Unused variable.
Solution: Remove the variable. (closesvim/vim#10829)
e95f22f63a
Problem: Scrollback can be wrong after redrawing the command line.
Solution: Clear unfinished scrollback when redrawing. (closesvim/vim#10807)
46af7bc08d
Problem: Command overlaps with printed text in scrollback.
Solution: Clear until end-of-line and use correct message chunk.
(closesvim/vim#10765, closesvim/vim#10764)
ecdc82e74e
N/A patches for version.c:
vim-patch:9.0.0070: using utfc_ptr2char_len() when length is negative
Problem: Using utfc_ptr2char_len() when length is negative.
Solution: Check value of length. (closesvim/vim#10760)
4dc513a22c
vim-patch:8.2.1147: :confirm may happen in cooked mode
Problem: :confirm may happen in cooked mode. (Jason Franklin)
Solution: Switch to raw mode before prompting. (Brandon Pfeifer)
27321dbeed
Code is N/A, but this improves tests. Port the improved tests to Lua.
Problem:
Since 0b9664f524 powershell filtered
:[range]! commands with args causes error:
"Start-Process: A positional parameter cannot be found that accepts argument ..."
Solution:
Pass args to Start-Process via `-ArgumentList`.
closes#19250
Problem:
Since right-click can now show a popup menu, we can provide messaging to
guide users who expect 'mouse' to be disabled by default. So 'mouse' can
now be enabled by default.
Solution:
Do it.
Closes#15521
Problem: Various code not covered by tests.
Solution: Add a few more test. (Yegappan Lakshmanan, closesvim/vim#7995)
1f448d906b
Cherry-pick some test_edit.vim changes from patches 8.2.{1022,1432}.
Reorder test_undo.vim to match upstream.
Problem: Character input not fully tested.
Solution: Add more tests. (Yegappan Lakshmanan, closesvim/vim#7963)
f4fcedc59d
Cherry-pick related changes from patches 8.2.{0433,0866}.
Problem:
1. Right-click does not work in statusline unless you left-click first (to focus
the statusline).
2. Modifier (e.g. shift+rightclick) does not work in statusline.
Solution:
Make clickable statusline sections receive right-clicks regardless of whether
the statusline is focused.
Closes#18994