Omitting replace_keycodes when it is false causes some confusion as its
default value is unclear. In nvim_set_keymap() it defaults to false, but
in vim.keymap.set() it defaults to true when it matters.
Problem: tests: inconsistent indent and line breaking in Test_maparg().
Solution: Consistently use spaces-only indent. Reorder fields to group
similar ones together and break lines at consistent positions.
Remove a mapping when it is no longer used (zeertzjq).
closes: vim/vim#19099254f844dda
Problem: Division by zero in :file after failing to wipe buffer
(after 8.2.4631).
Solution: Still call buf_clear_file() when failing to wipe buffer
(zeertzjq).
closes: vim/vim#190881aa5ca4ecb
Problem: Test_cd_completion test fails in Appveyor. In Appveyor, a path
containing spaces was selected as the test target. But the
comparison failed because spaces were not taken into account
(after v9.1.2050)
Solution: Escape spaces in paths for comparison (Muraoka Taro)
closes: vim/vim#19087679c2c01fa
Co-authored-by: Muraoka Taro <koron.kaoriya@gmail.com>
Problem: :edit and :enew may reuse a 1-line terminal buffer, causing
the new buffer to still be a terminal buffer.
Solution: Don't reuse a terminal buffer, as it's not reused when it has
more than 1 line.
After this change close_buffer() is the only place where buf_freeall()
can be called on a terminal buffer, so move the buf_close_terminal()
call into buf_freeall() to save some code. Furthermore, closing the
terminal in buf_freeall() is probably more correct anyway, as it is
"things allocated for a buffer that are related to the file".
Also, remove the useless check for on_detach callbacks deleting buffer.
Even if b_locked fails to prevent that, the crash will happen at the end
of buf_updates_unload() first. On the other hand, many other call sites
of buf_updates_unload() and other buffer_updates_* functions don't set
b_locked, which may be a problem as well...
Problem: Crash when deleting terminal buffer and TermClose switches
back to the terminal buffer.
Solution: Set b_locked_split.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
The test may wipe the wrong buffer if :bdelete switches to another one.
Also remove the builtin TermClose autocommand. It doesn't affect the
tests for now, but still it's better to avoid its interference.
Problem: Calling termopen() or nvim_open_term() on a buffer with an
existing terminal leads to two terminals writing to the same
buffer if the terminal job is still running, or memory leak
if the terminal job has exited.
Solution: Close the terminal if the terminal job has exited, otherwise
report an error. For nvim_open_term() also don't write a
closed terminal's buffer content to the PTY.
Problem: Crash when closing a split window if autocmds close other
split windows but there are still floating windows.
Solution: Bail out and give the window back its buffer.
Problem: Crash when a terminal receives OSC 2 just after closing its
buffer but before terminal job exits.
Solution: Remove FUNC_ATTR_NONNULL_ALL from buf_set_term_title() and
check for NULL.
Problem
LSP Related Information line and column numbers are 0-based. Displaying
them this way can confuse the user, since vim line/col numbers are
typically displayed 1-based.
Solution
Display the line and column numbers as 1-based.
Problem: Destroying a terminal with pending TermRequest leads to
heap-use-after-free when processing TermRequest afterwards.
Solution: Store the buffer handle instead of the Terminal pointer in the
pending TermRequest event, and don't emit TermRequest if the
terminal is already closed.
Problem: null pointer member access when closing the only non-float in the
current tab page if autocommands after closing all floats also close all other
tab pages. (making it the last window)
Solution: check last_window again after closing the floats.
Also reduce the scope of "wp"; it would be bugprone to use it before it's later
reassigned to the rv of win_free_mem if freed by Buf/WinLeave.
Problem: tests: Test_cd_completion() may fail depending on the contents
of the root directory of the current drive on Windows.
readdir() may return a directory that cannot "cd" to, causing
this test to fail. An example of such a directory is
"System Volume Information" which only admin can "cd" to.
Solution: When determining the directory to use for testing, use the
directory that we actually "cd" to successfully.
In addition, directories with '$' in their names are also
excluded, as they are considered environment variables during
completion and do not work as expected.
Example: "$RECYCLE.BIN" (Muraoka Taro).
closes: vim/vim#190786625ba359e
Co-authored-by: Muraoka Taro <koron.kaoriya@gmail.com>
Problem: When switching to another terminal buffer in Terminal mode,
usually Nvim stays in Terminal mode, but leaves Terminal mode
if the old terminal buffer was deleted.
Solution: Don't always leave Terminal mode when active terminal buffer
is deleted. Instead let terminal_check_focus() decide that.
Problem: :tlnumenu incorrectly accepts a range.
Solution: Remove EX_RANGE and EX_ZEROR from the command definition and
use ADDR_NONE (Doug Kearns).
closes: vim/vim#1905519442ad118
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: tests: test_menu.vim leaves swapfiles behind
Solution: Close open buffers using :bw! instead of :close!
7f5c60b31e
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_marks.vim leaves swapfiles behind
Solution: Close open buffers using :bw! instead of :close!
4fe7301df9
Co-authored-by: Christian Brabandt <cb@256bit.org>
With `overlap=true`, more extmarks than the requested limit may be
collected in `extmark_get`. This then leads to an out of bounds write of
`rv` in `nvim_buf_get_extmarks`.
Problem:
`:lsp restart` detects when a client has exited by using the `LspDetach`
autocommand. This works correctly in common cases, but breaks when
restarting a client which is not attached to any buffer. It also breaks
if a client is detached in between `:lsp restart` and the actual
stopping of the client.
Solution:
Move restart logic into `vim/lsp/client.lua`, so it can hook in to
`_on_exit()`. The public `on_exit` callback cannot be used for this, as
`:lsp restart` needs to ensure the restart only happens once, even if
the command is run multiple times on the same client.
Problem: The function get_logical_pos did not account for the possibility that a diagnostic might not have an associated extmark, leading to potential errors or incorrect behavior.
Solution: Add a check for diagnostic._extmark_id and return the logical positions directly if it does not exist.
Work on #37166
- Dynamic Registration Tracking via Provider
- Supports_Method
- Multiple Registrations
- RegistrationOptions may dictate support for a method
Problem: No test that undofile format does not regress
Solution: include a sample undofile to make sure we are always able to
read it
This is so, that we don't unintentionally change the undofile format and
make sure we can load an undo file that has been created by an older
Vim.
closes: vim/vim#1612714382c8bc9
Convert the undo file in samples/ using method from #13973.
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem:
We want to encourage implementing core features in Lua instead of C, but
it's clumsy because:
- Core Lua code (built into `nvim` so it is available even if VIMRUNTIME
is missing/invalid) requires manually updating CMakeLists.txt, or
stuffing it into `_editor.lua`.
- Core Lua modules are not organized similar to C modules, `_editor.lua`
is getting too big.
Solution:
- Introduce `_core/` where core Lua code can live. All Lua modules added
there will automatically be included as bytecode in the `nvim` binary.
- Move these core modules into `_core/*`:
```
_defaults.lua
_editor.lua
_options.lua
_system.lua
shared.lua
```
TODO:
- Move `_extui/ => _core/ui2/`
Problem:
Terminals should respond with the terminator (either BEL or ST) used in
the query so that clients can reliably parse the responses. The
`TermRequest` autocmd used to handle background color requests in the
terminal does not have access to the original sequence terminator, so it
always uses BEL. #37018
Solution:
Update vterm parsing to include the terminator type, then forward this
data into the emitted `TermRequest` events for OSC/DCS/APC sequences.
Update the foreground/background `TermRequest` callback to use the same
terminator as the original request.
Details:
I didn't add the terminator to the `TermResponse` event. However, I
assume the `TermResponse` event doesn't care about the terminator
because the sequence is already parsed. I also didn't update any of the
functions in `src/nvim/vterm/state.c` that write out responses. It
looked like those all pretty much used ST, and it would be a much larger
set of changes. In that same file, there's also logic for 8 bit ST
sequences, but from what I can tell, 8 bit doesn't really work (see `:h
xterm-8bit`), so I didn't use the 8 bit ST at all.
Problem: Deleting active plugins can lead to a situation when it is
reinstalled after restart.
Solution: Suggest "delete" code action only for not active plugins.
Whether a plugin is not active is visible by a hint in its header.
Problem: After `vim.pack.update()` it is not clear if plugin is active
or not. This can be useful to detect cases when plugin was removed
from 'init.lua' but there was no `vim.pack.del()`.
Solution: Add ` (not active)` suffix with distinctive highlighting to
header of plugins that are not active.
It will also be shown in in-process LSP document symbols to have quick
reference about which plugins are not active.
Problem: Using `vim.pack.del()` to delete active plugin can lead to
a situation when this plugin is reinstalled after restart. Removing
plugin from 'init.lua' is documented, but can be missed.
Solution: Make `del()` only remove non-active plugins by default and
throw an informative error if there is an active plugin.
Add a way to force delete any plugin by adding `opts.force`. This also
makes `del()` signature be the same as other functions, which is nice.
Problem: Buffer overflow in buf_write() when converting incomplete
multi-byte characters (Kevin Goodsell)
Solution: Make the buffer slightly larger
closes: vim/vim#19007f99de42a9f
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: bicep filetype used for 2 bicep file types
Solution: Detect *.bicepparam files as bicep-param filetype, include
new bicep-params and bicep filetype plugin
(Scott McKendry)
The bicep language server handles parameter files differently than
regular bicep files. Treating them the same at the editor level leads to
false positive diagnostics in the editor.
References:
Bicep Language Constants:
- 51392d32ca/src/Bicep.Core/LanguageConstants.cs (L23)
VS Code Extension definition:
- 51392d32ca/src/vscode-bicep/package.json (L47)closes: vim/vim#190264e722fdfdd
Co-authored-by: Scott McKendry <me@scottmckendry.tech>