Use only a single clear() call in some test/functional/vimscript/ test
files whose test cases have very little side effect.
A downside of using a single clear() is that if a crash happens in one
test case, all following test cases in the same file will also fail, but
these functionalities and tests don't change very often.
Problem: mbyte contains overlapping list of utf_classes table
Solution: Update table to contain non-overlapping list (Yuta Yamamoto)
closes: vim/vim#183629fa8a114b2
Co-authored-by: Yuta Yamamoto <jichael.y.yuta1995@gmail.com>
Problem:
pyenv-virtualenv sets a different path for VIRTUAL_ENV than the path to the
python binary it provides, but these paths both symlink to the same file, so
there should be no disparity. The python health-check reports an error, since it
only checks if these paths are equal, not where they point to (resolve to).
Solution:
- Resolve the python symlinks before checking if they are equal.
- Deduplicate some code.
Problem: completion: 'autocomplete' cannot be enabled per buffer
(Tomasz N)
Solution: Make 'autocomplete' global or local to buffer (Girish Palya)
fixes: vim/vim#18320closes: vim/vim#183330208b3e80a
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: "adding" expansion doesn't work with cfc=keyword.
Solution: Remove incorrect assignment to compl_cont_status. Don't use
fuzzy collection in "adding" status (zeertzjq).
related: neovim/neovim#35842closes: vim/vim#18351e19a882ffc
Problem: Mouse click to open fold doesn't work with utf-8 "foldclose"
chars (Balki)
Solution: Use ScreenLinesUC[off] if it is set (zeertzjq).
fixes: vim/vim#18344closes: vim/vim#183498b5fe7d090
Problem: cannot calculate sha256() of a Blob
Solution: Change sha256() to accept a Blob or String argument
(thinca).
closes: vim/vim#183364150283b83
Co-authored-by: thinca <thinca@gmail.com>
Two versions of the completion function are provided:
1. Uses bash-completion@2, which is the community standard for Bash
completions; version >= 2.12 offers a more user-friendly experience.
2. Uses only bash built-in syntax and completes options only.
Problem:
Scripts named with 'python-…' prefix may not be valid python bins. If
such a script is found in a venv, the Python healthcheck fails hard.
.venv/python-argcomplete-check-easy-install-script
.venv/bin/python3.13
.venv/bin/python
Solution:
- Discard known false-positives such as `python-argcomplete*`.
- Call `health.warn()` instead of `assert()` in `python_exepath()`.
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Problem: complete: some redraw issues with 'autocomplete'
Solution: Fix the issues (Girish Palya)
This commit contains the following changes:
* Fix that wildtrigger() might leave opened popupmenu around vim/vim#18298
* Remove blinking message on the command line when a menu item from a loaded
buffer is selected during 'autocomplete'
* Add a test for PR vim/vim#18265 to demonstrate why the PR is required for correct
'autocomplete' behavior
fixes: vim/vim#18298closes: vim/vim#18328ee9a2f0512
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: When the popup menu (PUM) occupies more than half the screen
height, it flickers whenever a character is typed or erased.
This happens because the PUM is cleared and the screen is
redrawn before a new PUM is rendered. The extra redraw between
menu updates causes visible flicker.
Solution: A complete, non-hacky fix would require removing the
CmdlineChanged event from the loop and letting autocompletion
manage the process end-to-end. This is because screen redraws
after any cmdline change are necessary for other features to
work.
This change modifies wildtrigger() so that the next typed
character defers the screen update instead of redrawing
immediately. This removes the intermediate redraw, eliminating
flicker and making cmdline autocompletion feel smooth
(Girish Palya).
Trade-offs:
This behavior change in wildtrigger() is tailored specifically for
:h cmdline-autocompletion. wildtrigger() now has no general-purpose use
outside this scenario.
closes: vim/vim#17932da9c966893
Use pum_check_clear() instead of update_screen().
Cherry-pick Test_wildtrigger_update_screen() change from patch 9.1.1682.
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: Crash in BufLeave/WinLeave/TabLeave when closing window after
BufUnload closes all other windows in the tab page.
Solution: Avoid duplicate BufLeave/WinLeave events. Trigger TabLeave
before removing the buffer (zeertzjq).
related: vim/vim#14166
related: neovim/neovim#33603closes: vim/vim#183300c70820015
Problem: Some filetype autocmds with patterns ending in * do not skip
filenames matching g:ignored_patterns.
Solution: Move these autocmds to the appropriate section and call
s:StarSetf() to set the filetype.
- Affected filetypes: dosini, execline, foam, messages, nginx, tmux.
- Convert foam filetype patterns to use wildcard matching.
closes: vim/vim#174226701480c43
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: 'ruler' is set in defaults.vim, but not enabled by default in
non-compatible mode.
Solution: set the ruler option in non-compatible mode, remove it from
defaults.vim, update tests
closes: vim/vim#18260ba36510920
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: defaults: 'showcmd' is not enabled in non-compatible mode on
Unix
Solution: Always enable 'showcmd' in non-compatible mode, drop it from
defaults.vim.
'showcmd' was already always enabled in Vim compatible mode except for
UNIX environments. So let's just enable it always, there is no good
reason why UNIX platforms should be handled differently than other
platforms, especially since `defaults.vim` did enable this option
anyhow.
closes: vim/vim#177393f9d2378bd
Co-authored-by: Christian Brabandt <cb@256bit.org>
The vim._extui.messages module uses multiple timers that last 2 or 4
seconds. If these timers aren't finished when a test ends, there will
be a 2-second delay on exit with ASAN or TSAN.
Problem:
If there are 2 language servers with different trigger chars (`-` and
`>`), and a keymap inputs both simultaneously (`->`), then `>` doesn't
trigger. We get completion items from server1 only.
This happens because the `completion_timer` for the `-` trigger is still
pending.
Solution:
If the next character arrived enough quickly (< 25 ms), replace the
existing deferred autotrigger with a new one that matches this later
character.
Problem: filetype: kitty config files are not recognized
Solution: Detect */kitty/*.conf as kitty filetype, include a syntax
script (Shawon).
closes: vim/vim#18280a946ccf5ff
Co-authored-by: Shawon <mdmoinulhossainshawon@gmail.com>
This fixes a regression from #33796.
I tried for several hours and cannot write a working test for this, but
this does fix the following warning in tests run with ASAN or TSAN:
-------- Running tests from test/functional/plugin/lsp_spec.lua
RUN T4667 LSP server_name specified start_client(), stop_client(): 114.00 ms OK
RUN T4668 LSP server_name specified stop_client() also works on client objects: 97.00 ms OK
RUN T4669 LSP server_name specified does not reuse an already-stopping client #33616: 31.00 ms OK
nvim took 2022 milliseconds to exit after last test
This indicates a likely problem with the test even if it passed!
Overriding vim.lsp.handlers['textDocument/formatting'] doesn't work here
because fake_lsp_server_setup() uses a table with __index to specify
client handlers, which takes priority over vim.lsp.handlers[], and as a
result the overridden handler is never called, and the test ends before
the vim.wait() even finishes.
Instead, set a global variable from the handler that is actually reached
(by vim.rpcrequest() from client handler), and avoid stopping the event
loop too early.