Problem: If the only highlight present in the buffer is an extmark, and its end
position is outside the screen, redraws that start on lines after the
first line of the mark will consider the buffer as not having any highlights,
and skip drawing the mark's highlight.
Solution: Check the updated number of decor ranges.
Problem: Extui does not route messages emitted as a result of a typed
command to the "more" window.
Command message leading shell messages is missing a kind.
Messages not routed to 'cmdheight' area after it was 0.
Solution: Route messages that were emitted in the same event loop as an
entered command to the "more" window. Also append multiple
messages in an already open more-window.
Assign it the `shell_cmd` kind.
Change message position when 'cmdheight' changes from 0.
Problem: Currently, 'smartcase' is respected when completing keywords
using <C-N>, <C-P>, <C-X><C-N>, and <C-X><C-P>. However, when
a user continues typing and the completion menu is filtered
using cached matches, 'smartcase' is not applied. This leads
to poor-quality or irrelevant completion suggestions, as shown
in the example below.
Solution: When filtering cached completion items after typing additional
characters, apply case-sensitive comparison if 'smartcase' is
enabled and the typed pattern includes uppercase characters.
This ensures consistent and expected completion behavior.
(Girish Palya)
closes: vim/vim#17271dc314053e1
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: Messages that are already added to the history are not emitted
as part of the "g<" msg_history_show event.
Solution: Move clearing the history for temporary messages to before
adding a message to the history, rather than after emitting
a message.
Problem: conceal_lines cache is invalidated in `on_buf`
which is too late for code calculating text height after a
buffer change but before a redraw (like `lsp/util.lua`).
Solution: Replace `on_buf` with `on_bytes` handler that invalidates
the cache and clears the marks.
Problem:
decorations_spec.lua, float_spec.lua, multigrid_spec.lua are not
auto-formatted.
Solution:
Add a special `formatlua2` cmake target, which invokes `stylua` with
an alternative `.stylua2.toml` config.
Problem: Missing kind and separate event for each line for message
containing buffer lines for e.g. `:print`.
Solution: Set the `list_cmd` kind and only `msg_start()` for the first
message, print a newline instead.
Problem:
Stopping a language server and then calling vim.lsp.start() with the same name/root will return the old language server that's in the middle of shutting down. vim.lsp.start() won't return a new server until the old process has terminated.
Solution:
Introducing a client._is_stopping field that tracks the shutdown phase, preventing the client from being reused.
Problem:
assert_log() only matches single lines. This was never an intentional
decision, it was merely a result of using read_file_list().
Note: any tests that indiscriminately match `.*` should be rewritten to
avoid (unlikely) "false positives". I checked all existing tests.
Solution:
Change assert_log() to match the concatenated lines instead of matching
per-line.
Problem: [security]: Possible to open more windows into a closing
buffer without splitting, bypassing existing "b_locked_split"
checks and triggering use-after-free
Solution: Disallow switching to a closing buffer. Editing a closing
buffer (via ":edit", etc.) was fixed in v9.1.0764, but add an
error message and check just "b_locked_split", as "b_locked"
is necessary only when the buffer shouldn't be wiped, and may
be set for buffers that are in-use but not actually closing.
(Sean Dewar)
closes: vim/vim#172466cb1c82840
Problem: Ruler is not cleared from the screen/ext_messages state when
it is no longer drawn after e.g. `set noruler` or when moving
from a floating to a regular window.
Solution: Remember if ruler was drawn and clear it.
Problem: `:copen` opens at the bottom by switching to `lastwin`,
needlessly changing the window it inherits context from.
Solution: Use the `WSP_BOT` flag to `win_split()` to open at the bottom.
Problem: Using `<C-W>w`, `<C-W>W` or the ":wincmd" variants with a count can
enter unfocusable or hidden floating windows. This is especially problematic
when using the new in-development extui, which creates many unfocusable floats
for various UI elements.
Solution: Skip unfocusable and hidden floating windows. Instead, skip to the
next focusable, non-hidden window in the current tabpage's window list. Reword
the documentation a bit (hopefully an improvement?)
Problem:
No way to check if a LSP config is enabled without causing it to
resolve. E.g. `vim.lsp.config['…'] ~= nil` will resolve the config,
which could be an unwanted and somewhat expensive side-effect.
Solution:
Introduce `vim.lsp.is_enabled()`.
**Problem:** For multiline diagnostics, the end column was improperly
calculated by checking the byte index of the character position on the
*start* line.
**Solution:** Calculate the byte index for end_col using the *end* line.
Problem: The TUI doesn't forward a key properly when it has unsupported
modifiers like NumLock.
Solution: Don't try to add modifiers when only unsupported modifiers are
present.
Related #33791
Problem:
stderr messages from executing ":!cmd" show up with
highlight hl-ErrorMsg. But some shell utilites use stderr for debug
logging, progress updates, etc.
Solution:
Highlight shell command outputs hl-StderrMsg and hl-StdoutMsg.
This fixes the problem that sending a raw C0 control code to trigger a
mapping for it does not work in Terminal mode.
Note: this isn't done for 00 or 7F, as that'll be backward-incompatible.
NEW BUILD SYSTEM!
This is a MVP implementation which supports building the "nvim" binary,
including cross-compilation for some targets.
As an example, you can build a aarch64-macos binary from
an x86-64-linux-gnu host, or vice versa
Add CI target for build.zig currently for functionaltests on linux
x86_64 only
Follow up items:
- praxis for version and dependency bumping
- windows 💀
- full integration of libintl and gettext (or a desicion not to)
- update help and API metadata files
- installation into a $PREFIX
- more tests and linters
Problem: Vim incorrectly escapes tags containing "[" in a help buffer
Solution: check if the buffer has the "help" filetype set, instead of
already being a help buffer (Phạm Bình An)
fixes: vim/vim#17224closes: vim/vim#172326af20a9be3
Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem:
virtual_text diagnostics are great when skimming a file, and
virtual_lines are great when "zooming in" on a particular problem.
Having both enabled results in duplicate diagnostics on-screen.
Solution:
This PR expands the behavior of `current_line` for virtual_text and
virtual_lines by making `virtual_text.current_line = false` distinct
from `nil`. If you set:
vim.diagnostic.config({
virtual_text = { current_line = false },
virtual_lines = { current_line = true },
})
With this configuration, virtual_text will be used to display
diagnostics until the cursor reaches the same line, at which point they
will be hidden and virtual_lines will take its place.
Problem: Wrong winline info after partial redraw. Setting
`conceal_cursor_used` is unnecessarily spread out.
Solution: Rather than adjusting `wl_lastlnum` for the previous
winline, adjust it when setting the current winline.
Set `conceal_cursor_used` when the current window is redrawn.
Problem:
enable() could be more flexible, so that it works even if called "late".
Solution:
- enable(true) calls `doautoall nvim.lsp.enable FileType`.
- enable(false) calls `client:stop()` on matching clients.
This will be useful for e.g. :LspStop/:LspStart also.
Problem:
Directories that are "trusted" by `vim.secure.read()`, are not detectable later
(they will prompt again). https://github.com/neovim/neovim/discussions/33587#discussioncomment-12925887
Solution:
`vim.secure.read()` returns `true` if the user trusts a directory.
Also fix other bugs:
- If `f:read('*a')` returns `nil`, we treat that as a successful read of
the file, and hash it. `f:read` returns `nil` for directories, but
it's also documented as returning `nil` "if it cannot read data with the
specified format". I reworked the implementation so we explicitly
treat directories differently. Rather than hashing `nil` to put in the
trust database, we now put "directory" in there explicitly*.
- `vim.secure.trust` (used by `:trust`) didn't actually work for
directories, as it would blindly read the contents of a netrw buffer
and hash it. Now it uses the same codepath as `vim.secure.read`, and
as a result, works correctly for directories.
In a floating window grid, "wrap" flag should not
be set when vertical borders are used, as the the wrapped
text will be broken up by border chars.
fixes#33719
Problem: UIs implementing ext_cmdline/message must also implement
ext_popupmenu in order to get cmdline completion with
wildoptions+=pum.
Solution: Allow marking a window as the ext_cmdline window through
nvim_open_win(), including prompt offset. Anchor the cmdline-
completion popupmenu to this window.
Problem: Delay for reading a message may be unwanted for ext_messages,
and can be done by the implementation. Empty completion source
error message is not distinguishable as such.
Solution: Only delay without ext_messages enabled. Emit empty completion
source message as an error.
clarify complete_match() documentation to better explain its backward
search behavior, argument handling, and return value format and add an
example of isexpand
closes: https://github.com/vim/vim/pull/17212ffc89e47d0