Problem: tests: test_modeline.vim fails (after v9.2.0276)
Solution: Rewrite the tests to use the existing s:modeline_fails()
function, update documentation (zeertzjq).
8c8772c6b3
Problem:
`:Tutor` should open a copy of the tutor file instead of the original. This is
because edits modify the original file buffer, and crashes or other misuse could
potentially corrupt the original file even if it's WO.
Solution:
Copy the tutor file to a temp path before opening. Store the original path in
`b:tutor_file` so metadata json loading still works.
- `tutor#TutorCmd` will now copy the tutor file to a temp path via `tempname()`
before opening with `drop`. Store the original path in `b:tutor_file` only
after the buffer is created.
- `tutor#LoadMetadata` now uses `b:tutor_file` to resolve the JSON path instead
of `expand('%')`, which now points to the temp copy buffer
- `ftplugin/tutor.vim` does not make the `tutor#LoadMetadata` call anymore. It
was guarded by `filereadable(expand('%').'.json')` which fails for the new
temp copy path logic . Instead, `tutor#LoadMetadata` is already called
directly inside `tutor#TutorCmd` since we are already assumed to enable
interactive.
Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Problem: 'showcmd' causes flickering when pressing "g<" to enter the
pager when the cmdline is expanded for messages.
Initial keypress for an incomplete mapping is not giving 'showcmd'
feedback while cmdline is expanded for messages (which is only
dismissed upon the vim.on_key callback after 'timeoutlen').
Solution: Delay dismissing expanded cmdline when vim.on_key() callback
receives "g".
Place 'showcmd' "last" virtual text during expanded cmdline.
Problem: When 'ruler' is in last line of the screen and the current
floating window is closed, the ruler is not cleared.
Solution: When closing the current floating window, redraw the cmdline
if that contained, and will no longer contain the 'ruler'.
Problem: Cmdline is not redrawn after an empty message clears it.
Remembered last drawn cursor position may be outdated but
equal to the current cmdline content with UI2.
Solution: Ensure cmdline is redrawn after an empty message clears it.
Compare wanted cursor position with actual cursor position.
Problem: fileinfo not shown after :bd of last listed buffer
(memeplex)
Solution: Set need_fileinfo to true in empty_curbuf()
(Hirohito Higashi)
When deleting the last listed buffer with :bd, the new empty buffer's
file info (e.g. "[No Name]" --No lines in buffer--) was not displayed.
do_ecmd() only calls fileinfo() for existing buffers (oldbuf), not for
newly created empty buffers.
Set need_fileinfo in empty_curbuf() so the file info is displayed after
redraw.
fixes: vim/vim#548closes: vim/vim#198023d472d8675
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Let's add the --no-location to the xgettext command line call, so that
the generated vim.pot file does not contain the message location. Those
will get out of date soon and we don't want to update vim.pot just
because the location in a comment changes.
2844765e90
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: `vim._core.ui2.enable` requires passing an empty table for
default options, unlike other (native) Lua API.
Solution: Initialize `opts` with empty table if `nil` is passed.
Problem: Mixing "buf" and "M.bufs.msg" in M.msg:start_timer().
Cannot run `require("vim._core.ui2").enable(nil)`.
Solution: Replace "M.bufs.msg" with "buf". Allow `opts == nil`.
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
vim-patch:9.1.0333: tests: test_xdg fails on the appimage repo
vim-patch:9.1.0336: tests: typo in test_xdg
vim-patch:9.1.0339: tests: xdg test uses screen dumps
vim-patch:9.1.0347: A few typos in test_xdg when testing gvimrc
vim-patch:b9897ec27 runtime(xdg): remove // from 'undo' and 'viwedir'
vim-patch:2e9e7cb8e runtime(xdg): Move viminfofile storage to state dir
vim-patch:9.2.0255: tests: Test_popup_opacity_vsplit() fails in a wide terminal
vim-patch:9.2.0260: statusline not redrawn after closing a popup window
vim-patch:9.2.0261: terminal: redraws are slow
vim-patch:9.2.0264: Cannot disable kitty keyboard protocol in vim :terminal
vim-patch:9.2.0268: memory leak in call_oc_method()
vim-patch:9.2.0269: configure: Link error on Solaris
vim-patch:9.2.0258: memory leak in add_mark()
Problem:
LSP jump operations such as `buf.definition`/`buf.type_definition` do
not follow the 'switchbuf' option. Instead their behavior is controlled
by `vim.lsp.LocationOpts.reuse_win`. When `reuse_win=true`, the effect
is very similar to `set switchbuf=useopen`.
Note that functions like `buf.definition` open the quickfix
window when there are multiple results, and jumping between quickfix
entries already follows 'switchbuf', so unifying the behavior is more
intuitive.
Solution:
Follow the 'switchbuf' option and drop `reuse_win`.
We can achieve this behavior by using :cfirst when the quickfix list has
only one item, rather than customizing the jump logic as before.
The NULL checks added in #35679 are no longer needed after #38473.
_____________________________________________________________________________________________
*** CID 645258: (REVERSE_INULL)
/src/nvim/buffer.c: 645 in close_buffer()
639 // Autocommands deleted the buffer.
640 emsg(_(e_auabort));
641 return false;
642 }
643 buf->b_locked--;
644 buf->b_locked_split--;
>>> CID 645258: (REVERSE_INULL)
>>> Null-checking "win" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
645 if (abort_if_last && win != NULL && one_window(win, NULL)) {
646 // Autocommands made this the only window.
647 emsg(_(e_auabort));
648 return false;
649 }
650 }
/src/nvim/buffer.c: 626 in close_buffer()
620 // Autocommands deleted the buffer.
621 emsg(_(e_auabort));
622 return false;
623 }
624 buf->b_locked--;
625 buf->b_locked_split--;
>>> CID 645258: (REVERSE_INULL)
>>> Null-checking "win" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
626 if (abort_if_last && win != NULL && one_window(win, NULL)) {
627 // Autocommands made this the only window.
628 emsg(_(e_auabort));
629 return false;
630 }
631
Problem:
Since neovim 0.12, shift + arrow keys no longer works in rxvt-unicode
(TERM=rxvt-unicode-256color).
Solution:
Re-add `left` and `right` to `wanted_termkeys` so they're read from
terminfo instead of being handled by driver-csi. There seems to be quite
a few other terminals that define kLFT in terminfo.src and these are
likely to be affected as well.
Fixes: https://github.com/neovim/neovim/issues/38571
Fixes: 4b678a499c ("refactor(termkey): make termkey use internal terminfo properly")
Problem:
`gen_terminfo.lua`'s output is unpredictable and depends on the system
ncurses version.
Invoking `tic` on `scripts/windows.ti` alone makes it use the system
terminfo definitions for the `use=…` fragments in `windows.ti` such as:
use=xterm+256color, use=xterm+sl, use=xterm-new
This is particularly problematic on Debian, as they build ncurses with
`--with-xterm-kbs=del` [1], and thus some of the windows entries end up
with different definitions for `kTermKey_left`, which is almost
certainly not desired.
[1]: 2d238cf387/debian/rules (L149)
Solution:
This reverts commit 9f90992934.
Problem: buffer underflow in vim_fgets()
Solution: Ensure size is always greater than 1
(Koda Reef)
3c0f8000e1
This currently never happens in Nvim.
Co-authored-by: Koda Reef <kodareef5@gmail.com>
* vim-patch:9.2.0019: Hard to configure Vim according to full XDG spec
Problem: Hard to configure Vim according to full XDG spec
Solution: Include the $VIMRUNTIME/xdg.vim script as an example.
(Andrey Butirsky).
closes: vim/vim#19421
----
Nvim already supports XDG spec and provides 'stdpath()'.
runtime/xdg.vim is N/A.
----
4f04efb760
* vim-patch:9.1.0327: No support for using $XDG_CONFIG_HOME
Problem: No support for using $XDG_CONFIG_HOME
Solution: optionally source $XDG_CONFIG_HOME/vim/vimrc
(Luca Saccarola)
fixes: vim/vim#2034closes: vim/vim#14182
---
test_xdg.vim can be applicable but it's a chore to swap "vimrc" with
"init.vim" and comment out gvimrc in all tests.
Nvim has enough XDG functional tests and runtime documentation.
Vim eventually rewrites the screendump tests such that
Nvim can run them in Unix-like systems.
It's possible to just port the latest version
and treat the older patches as N/A.
---
c9df1fb35a
Problem: w_locked can be bypassed when recursively set if not restored
to its prior value.
Solution: Rather than save/restore everywhere, just make it a count,
like other locks (Sean Dewar)
Requires the previous commit, otherwise b_nwindows will be wrong in
tests, which causes a bunch of weird failures.
closes: vim/vim#197287cb43f286e
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Problem: close_buffer() callers incorrectly handle b_nwindows,
especially after nasty autocmds, allowing it to go
out-of-sync. May lead to buffers that can't be unloaded, or
buffers that are prematurely freed whilst displayed.
Solution: Modify close_buffer() and review its callers; let them
decrement b_nwindows if it didn't unload the buffer. Remove
some now unneeded workarounds like 8.2.2354, 9.1.0143,
9.1.0764, which didn't always work (Sean Dewar)
(endless yapping omitted)
related: vim/vim#19728bf21df1c7b
b_nwindows = 0 change for free_all_mem() was already ported.
Originally Nvim returned true when b_nwindows was decremented before the end was
reached (to better indicate the decrement). That's not needed anymore, so just
return true only at the end, like Vim. (retval isn't used anywhere now anyways)
Set textlock for dict watchers at the end of close_buffer() to prevent them from
switching windows, as that can leave a window with a NULL buffer. (possible
before this PR, but the new assert catches it; added a test)
Despite textlock, things still aren't ideal, as watchers may observe the buffer
as unloaded and hidden (b_nwindows was decremented), yet still in a window...
Likewise, for Nvim, wipe_qf_buffer()'s comment may not be entirely accurate;
autocmds are blocked, but on_detach callbacks (textlocked) and dict watchers may
still run. Might be problematic, but those aren't new issues.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Problem: if close_buffer() in set_curbuf() unloads curbuf, NULL pointer
accesses may occur from enter_buffer() calling
end_visual_mode(), as curbuf is already abandoned and possibly
unloaded. Also, selection registers may not contain the
selection with clipboard+=autoselect(plus).
Solution: Move close_buffer()'s end_visual_mode() call to buf_freeall(), after
any autocmds that may restart it, but just before freeing anything
(Sean Dewar)
related: vim/vim#19728a8fdfd4fcb
Maybe this should be considered partial? clipboard+=autoselect isn't
implemented. If it is, we may need to update these comments to mention
TextYankPost being possible, and unskip its test.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Problem:
The snippet preview is not being highlighted by treesitter for
completion items from servers which don't support
`completionItem/resolve` (like gopls). This was broken by #38428.
Solution:
Call `update_popup_window` after updating the completion item with the
snippet preview.
I've added assertions to the `selecting an item triggers
completionItem/resolve + (snippet) preview` test case which covers the
snippet preview being shown since no tests failed when I removed the
`nvim__complete_set` call which actually populates the preview on this
codepath.