Problem: completion: flicker when LSP server is slow
Solution: reinsert leader text before invoking user function
(Girish Palya)
Reference:
https://github.com/girishji/vimcomplete/issues/101#issuecomment-3343063245
In insert-mode completion, the leader text is temporarily removed while
searching for candidates. When the LSP server responds slowly, the
client may call `:sleep` to wait, which triggers `out_flush()`. This
causes the deleted text to disappear briefly before being redrawn,
resulting in visible flicker.
This commit reinserts the leader text before invoking the user function,
and removes it again afterward to eliminate flicker.
closes: vim/vim#18468c51d1cc578
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: diff: w_topline may be invalidated
Solution: Update lnum in diff_set_topline()
(Yee Cheng Chin).
This can happen in ex_diffupdate() for certain edge cases which cause
the logic to now be wrong. This was also the root cause for vim/vim#18437 where
Vim would crash due to a null pointer dereferencing (said pointer would
not be null under normal circumstances).
related: vim/vim#18437closes: vim/vim#18484dd9ed46a39
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Problem: tests: no test for displaying 'foldcolumn' with Unicode
"foldinner" in 'fillchars'.
Solution: Add a few more test cases. Also fix misplaced "foldinner"
entry in version9.txt (zeertzjq).
closes: vim/vim#18483bcf44668f6
Problem: requested window size passed to nvim_open_win for splits may be ignored
by win_split_ins if it decides to forcefully equalize window sizes instead (e.g:
in an attempt to make room for the new window).
Solution: try to set the size again if it differs from what was requested.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Problem: Cannot configure the inner foldlevel indicator for the
foldcolumn
Solution: Add "foldinner" suboption value to the 'fillchar' option
(Maria José Solano).
closes: vim/vim#183651a691afd27
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Problem: filetype: Not all PKL files are recognized
Solution: Detect *.pcf as pkl filetype, detect using the pkl-lsp://
protocol as pkl filetype, include PKL syntax script
(Jan Claußen)
This adds basic syntax support for the new PKL language by Apple.
What works:
- Shebang support
- Comment support
- Integers (decimal, hex, octal and binary) support
- Floating point support including exponentials
- Basic datatype support
- Unicode escape delimiters
- Escape code support
- String interpolation
- Support up to five pounds for custom delimiters
- Folding of multi-line comments and blocks
What doesn't work:
The language heavily uses parameterized type declarations, which can get
very complex. It is very hard to highlight this properly. There is
official Tree-sitter support for this. Since it is hard to pull this off
in a vim syntax file, I opted for basic support of the data types.
References:
https://github.com/apple/pkl-pantryfixes: vim/vim#18271closes: vim/vim#1827467a8f2945e
Co-authored-by: Jan Claußen <jan.claussen10@web.de>
Problem: completion: some issues with 'acl' when "preinsert" and
"longest" is in 'completeopt' (musonius, after v9.1.1638)
Solution: Fix various issues (see details below) (Girish Palya)
This commit addresses multiple issues in the 'autocompletedelay' behavior with
"preinsert" and "longest":
- Prevents spurious characters from being inserted.
- Ensures the completion menu is not shown until `autocompletedelay` has
expired.
- Shows the "preinsert" effect immediately.
- Keeps the "preinsert" effect visible even when a character is deleted.
fixes: vim/vim#18443closes: vim/vim#18460f77c187277
Co-authored-by: Girish Palya <girishji@gmail.com>
The domain highlight is eazy to be confused and useless. Because we can
catch URL as a much obvious syntax.
closes: vim/vim#184670a8b4ef8b2
Co-authored-by: Mao-Yining <mao.yining@outlook.com>
This updates the new tutor with the changes from commit
b87f133b0724f7328e7dd41dd611af67f4ae3e39
closes: vim/vim#184619d57fe278f
Link to :checkhealth for clipboard support.
Co-authored-by: RestorerZ <restorer@mail2k.ru>
Problem: Significant code duplication between the two command parsing functions
Solution: Extract shared parsing logic into helper functions while preserving original behavior
> The macOS 13 runner image will be retired by December 4th, 2025.
Update to the macos-15-intel runner.
It seems that runners ending with "large" require an enterprise plan, so
macos-15-intel is the only other available macOS Intel runner.
This commit changes `languagetree.lua` so that it creates a scratch
buffer under the hood when dealing with string parsers. This will make
it much easier to just use extmarks whenever we need to track injection
trees in `languagetree.lua`. This also allows us to remove the
`treesitter.c` code for parsing a string directly.
Note that the string parser's scratch buffer has `set noeol nofixeol` so
that the parsed source exactly matches the passed in string.
Problem: possible crash when calculating topline in diff.c
(youngmith)
Solution: Check for pointer being Null before accessing it
fixes: vim/vim#18437d32b3bb7eb
The POC is likely not applicable to Nvim due to #32160.
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Vim tests are slow and flaky at the same time due to reliance
on timeouts which are unreliable.
Solution: improve Vim test performance and reduce flakiness
(Yee Cheng Chin)
A lot of Vim tests currently rely on waiting a specific amount of time
before asserting a condition. This is bad because 1) it is slow, as the
timeout is hardcoded, 2) it's unreliable as a resource-starved runner
may overshoot the timeout. Also, there are a lot of builtin sleep
commands in commonly used utilities like VerifyScreenDump and WaitFor()
which leads to a lot of unnecessary idle time.
Fix these issues by doing the following:
1. Make utilities like VerifyScreenDump and WaitFor use the lowest wait
time possible (1 ms). This essentially turns it into a spin wait. On
fast machines, these will finish very quickly. For existing tests
that had an implicit reliance on the old timeouts (e.g.
VerifyScreenDump had a 50ms wait before), fix the tests to wait that
specific amount explicitly.
2. Fix tests that sleep or wait for long amounts of time to instead
explicitly use a callback mechanism to be notified when a child
terminal job has finished. This allows the test to only take as much
time as possible instead of having to hard code an unreliable
timeout.
With these fixes, tests should 1) completely quickly on fast machines,
and 2) on slow machines they will still run to completion albeit slowly.
Note that previoulsy both were not true. The hardcoded timeouts meant
that on fast machines the tests were mostly idling wasting time, whereas
on slow machines, the timeouts often were not generous enough to allow
them to run to completion.
closes: vim/vim#16615e70587dbdb
Part of shared.vim and test_crash.vim changes only.
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Fixes#35884
Problem: Since `once_buf_loaded` might call a callback passed to it at a
later point (which is it's reason to exist) that callback might end up
referring to stale diagnostics in a handler's `show` function. For
example, if we first call `vim.diagnostic.set` for an unloaded buffer,
then call `vim.diagnostic.reset` and only then load the buffer, we might
still see diagnostics from `vim.diagnostic.set` call, which are stale at
this point.
Solution: only keep one autocommand from the most reset `show` call and
delete it when `hide` is called.
**Problem(?):** Buffers that (for whatever reason) aren't meant to have
a final newline are still parsed with a final newline in `treesitter.c`.
**Solution:** Don't add the newline to the last buffer line if it
shouldn't be there. (This more closely matches the approach of
`read_buffer_into()`.)
This allows us to, say, use a scratch buffer with `noeol` and `nofixeol`
behind the scenes in `get_string_parser()`.
...which would allow us to track injection trees with extmarks in that
case.
...which would allow us to not drop previous trees after reparsing a
different range with `get_parser():parse()`.
...which would prevent flickering when editing a buffer that has 2+
windows to it in view at a time.
...which would allow us to keep our sanity!!!
(one step at a time...)
Problem: tests: "Untitled" file not removed when running Test_crash1_3 alone
with TEST_FILTER (after v9.1.0695)
Solution: Use a TearDown function instead of another test.
(zeertzjq)
closes: vim/vim#15578closes: vim/vim#15577d56c451e1c
Problem: tests: test_crash leaves Untitled file around
Solution: cleanup at the end of the test_crash.vim test file
cd83173def
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: buffer-overflow in do_search() with 'rightleft'
(SuyueGuo)
Solution: after reversing the text (which allocates a new buffer),
re-calculate the text length
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-v2x2-cjcg-f9jmcacb6693c1
Add missing change from patch 8.1.1270.
Omit `call delete('Untitled')`: moved again in patch 9.1.0695.
Co-authored-by: Christian Brabandt <cb@256bit.org>
The current description (especially the "unlimited width" part) is
inaccurate in several ways:
- The size of virtual text can depend on window width. In particular,
the size of "above" virtual text can be equal to window width.
- A double-width character that doesn't fit adds 1 to the virtual column
of the following characters.
- The size of 'showbreak' and 'breakindent' is counted.
related: vim/vim#5713closes: vim/vim#18447014c731fa5
Problem:
Autocmds in inline_completion Completor are not scoped to specific
buffers. When multiple buffers have inline completion enabled, events
(InsertEnter, CursorMovedI, TextChangedP, InsertLeave) in any buffer
trigger callbacks for all Completor instances, causing incorrect
behavior across buffers.
Solution:
Add `buffer = bufnr` parameter to nvim_create_autocmd() calls to make
them buffer-local. Each Completor instance now only responds to events
in its own buffer.
Problem: Marks are lost after `:bdelete` because `ignore_buf()` filters
out unlisted buffers during shada mark processing.
Solution: Revert to original buffer checks for mark operations, avoiding
`!buf->b_p_bl` condition that incorrectly ignores deleted buffers.
Problem: completion: "longest" doesn't work for manual completion when
'autocomplete' is on (after 9.1.1800).
Solution: Only reset compl_get_longest when enabling autocompletion
(zeertzjq).
closes: vim/vim#18430b3966d6a8e
Change the second "if" to "because", otherwise it may be misinterpreted
that preinserted() can return non-zero just because these options are
set.
closes: vim/vim#184094edaf89233
Problem: completion: autocompletion can be improved
Solution: Add support for "longest" and "preinsert" in 'autocomplete';
add preinserted() (Girish Palya)
* Add support for "longest" in 'completeopt' when 'autocomplete'
is enabled. (Note: the cursor position does not change automatically
when 'autocomplete' is enabled.)
* Add support for "preinsert" when 'autocomplete' is enabled. Ensure
"preinsert" works the same with and without 'autocomplete'
* introduce the preinserted() Vim script function, useful for defining
custom key mappings.
fixes: vim/vim#18314closes: vim/vim#18387c05335082a
Co-authored-by: Girish Palya <girishji@gmail.com>