* cache all tokens from various range requests for a given document
version
- all new token highlights are merged with previous highlights to
maintain order and the "marked" property
- this allows the tokens to stop flickering once they've loaded once
per document version
* abandon the processing coroutine if the request_id has changed instead
of relying only on the document version
- this will improve efficiency if a new range request is made while a
previous one was processing its result
* apply new highlights from processing coroutine directly to the current
result when the version hasn't changed
- this allows new highlights to be immediately drawable once they've
processed instead of waiting for the whole response to be processed
at once
* rpc layer was changed to provide the request ID back in success
callbacks, which is then provided as a request_id field on the handler
context to lsp handlers
Usually, terminal_close() calls refresh_terminal(), which allocates the
scrollback buffer, and term_may_alloc_scrollback() in terminal_open()
won't dereference the buffer. However, refresh_terminal() is not called
during Nvim exit, in which case a heap-use-after-free may happen if
TermOpen wipes buffer. Check for non-NULL buf_handle to avoid that.
Problem: When TermOpen polls for enough events to use the scrollback
buffer, scrollback is lost until the next terminal refresh.
Solution: Allocate the scrollback buffer when it's needed.
Problem: Fast context for msg_show event inhibits vim.ui_attach from
displaying a stream of messages from a single command.
Solution: Remove fast context from msg_show events emitted as a result
of explicit API/command calls. The fast context was originally
introduced to prevent issues with internal messages.
Problem: filetype: skhd files are not recognized
Solution: Detect .skhdrc and skhdrc as skhd filetype,
include a syntax and filetype plugin, add syntax tests
(Kiyoon Kim)
Add syntax highlighting for skhd (simple hotkey daemon for macOS)
configuration files. Includes filetype detection for skhdrc and
.skhdrc files.
Reference:
- https://github.com/asmvik/skhdcloses: vim/vim#19235e5f61842b5
Co-authored-by: Kiyoon Kim <kiyoon@users.noreply.github.com>
Problem: tests: test_crash.vim times out in CI ASAN builds
Solution: Increase timeout for ASAN or Valgrind runs
closes: vim/vim#1872589f0a3a574
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: CI Tests favor GTK2 over GTK3
Solution: Install GTK3 dependencies and debug packages for CI workflows,
update ASAN suppression list, update required dependency
checks for the tests (Drew Vogel)
closes: vim/vim#17253ea67ba718d
Cherry-pick test_match.vim changes from patch 9.0.0626.
Co-authored-by: Drew Vogel <dvogel@github>
Problem: Using popup menu may leave text in the command line.
Solution: Clear the command line if the popup menu covered it. (Luuk van
Baal, closesvim/vim#12286)
dcd40cfca0
No code change is need in Nvim and testing is already covered by
test/functional/ui/popupmenu_spec.lua.
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
Problem: Using freed memory when executing unmenu at the more prompt.
Solution: Do not clear menus while listing them. (closesvim/vim#11439)
920d311480
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Esc on commandline executes command instead of abandoning it.
Solution: Save and restore KeyTyped when removing the popup menu.
(closesvim/vim#10154)
11a57dfd16
No code change is needed in Nvim as Nvim doesn't call update_screen() to
redraw pum.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Not enough tests for using plain_vgetc().
Solution: Add tests for using plain_vgetc() during various commands.
(zeertzjq)
closes: vim/vim#192362b6bdbc697
Problem: Test_foldtextresult_rightleft() does not restore 'columns'
(after v9.1.2102)
Solution: Save and restore the value of 'columns' (zeertzjq).
related: vim/vim#19220
closes: vim/vim#192344fcbc70fb1
Problem: tests: test_fold.vim leaves swapfiles behind
Solution: Close open buffer using :bw! instead of :close!
10b272c126
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Multiple eol_right_align virtual texts with different widths
are incorrectly positioned. The lookahead loop uses `item` instead of
`lookaheadItem` when checking kind and accessing data, causing all
items to use the first item's width.
Solution: Use `lookaheadItem->kind` and `lookaheadItem->data.vt`
instead of `item->kind` and `item->data.vt` in the lookahead loop.
fix(api): auto-load buffers in nvim_buf_set_* operations
Problem: Setting marks, lines, or text on unloaded buffers fails because
ml_line_count is not accurate until the buffer is loaded.
Solution: Add require_loaded_buffer() helper and use it in write operations
(nvim_buf_set_lines, nvim_buf_set_text, nvim_buf_set_mark). These now
auto-load buffers as needed.
Problem: has("terminfo") test fails on local runs because it expects
"HAVE_UNIBILIUM " in the :version info to mean that nvim was built
without unibilium.
Solution: Assume nvim is built with unibilium if HAVE_UNIBILIUM is
present in the version string and is NOT followed by 0, false, or off.
This isn't affecting CI runs because when the test detects that it is
running in CI it doesn't use the :version string at all.
Resolves https://github.com/neovim/neovim/issues/37456
* test(core/channels_spec): fix flaky test
Always use expect_stdout() to check PTY output.
* test(autocmd/termxx_spec): fix flaky test
Usually the Ctrl-C cancels the following :qa!, but sometimes it doesn't,
and Nvim exits before feed() returns. Instead make sure that :qa! always
reaches Nvim and use expect_exit().
Problem:
Crashed Nvim leaves socket files. Subsequent starts fail with "address already in use".
Solution:
On bind failure, test socket liveness via connect(). Remove if stale, retry bind().
Fixes#36581
Problem:
With shadow border, scrollbar and border overlap. Shadow's right border
starts from the second row (offset by 1), but scrollbar renders on every
row including the first. If they share a column, the first row shows
scrollbar where shadow hasn't started yet, causing misalignment.
Solution:
Separate scrollbar from the shadow's right border.
Problem: Crash with 'wildmenu' when typing Ctrl-Y after Ctrl-A
(after 9.1.1714) (fizz-is-on-the-way).
Solution: Check if there are matches before applying one (zeertzjq).
closes: vim/vim#19210311b98d942
Problem: :wqall! doesn't quit when using :quit in BufWritePost
(after 8.0.1190).
Solution: Restore old value of "exiting" when calling not_exiting()
instead of always resetting it to FALSE (zeertzjq).
related: vim/vim#2205
closes: vim/vim#19212e803ad1c56
Problem: TabClosedPre may be triggered twice for the same tab page when
closing another tab page in BufWinLeave (after 9.1.1211).
Solution: Store whether TabClosedPre was triggered in tabpage_T
(zeertzjq).
Also fix the inconsistency that :tabclose! triggers TabClosedPre after
a failed :tabclose, but :close! doesn't even if there is only one window
in the tab page.
closes: vim/vim#192119168a04e0c
Problem: heap-use-after-free when wiping buffer in TabClosedPre.
Solution: Check window_layout_locked() when closing window(s) in another
tabpage (zeertzjq).
closes: vim/vim#191968fc7042b3d
Problem: tests: not checking error numbers properly.
Solution: Add a trailing comma to avoid matching a different error
number with the same prefix (zeertzjq)
closes: vim/vim#1715967fe77d272
Problem: TabClosedPre is triggered just before the tab is being freed,
which limited its functionality.
Solution: Trigger it a bit earlier and also on :tabclose and :tabonly
(Jim Zhou)
closes: vim/vim#16890bcf66e0141
Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
Problem: Some plugins have a problem with the error check for using
:command with -complete but without -nargs.
Solution: In legacy script only give a warning message.
cc7eb2aa7a
Align tests with Vim only.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: A message ending in an unprintable character may emit a
msg_show event with the "empty" kind. No empty message event
for echom "".
Solution: Adjust conditions for emitting "empty" msg_show events.
Problem:
Creating an autocommand which executes `:bwipe` on the Syntax event
causes a heap-use-after-free.
Solution: set BF_SYN_SET flag before applying autocommands
Problem:
When text is too long, it overflows into the border. This happens because
grid_line_maxcol includes border columns, so grid_line_puts can write
there.
Solution:
Truncate string to available width when need_fcs_trunc is set.
When width1 and width2 are negative the assertion may fail. It seems
that adding a negative value to w_curswant won't cause any problems, so
just change the assertion.
Problem: nvim_parse_expression null pointer dereference with unmatched ]
followed by a node.
Solution: if ast_stack was empty, set new_top_node_p to top of the stack after
pushing the list literal node; similar to what's done for curlies.
This bug was originally found by a Matrix user, but I couldn't remember how to
trigger it... Ran into the other crash while finding a repro. :P
Problem: nvim_parse_expression null pointer dereference when parsing an
identifier followed by { with "highlight" parameter set to false.
Solution: only set opening_hl_idx if pstate->colors is not NULL.
Not added to parser_tests.lua as that uses highlight = true.