Problem: As in f85bc41, assume unfocusable windows to be UI windows
whose buffer content is unexpectedly included in 'complete'
"w" completion.
Solution: Exclude unfocusable windows when looping over windows.
(cherry picked from commit d01b2611a6)
Problem:
Some language servers do not work properly without a workspace folder.
Solution:
Add `workspace_required`, which skips starting the lsp client if no
workspace folder is found.
Co-authored-by: Michael Strobel <71396679+Kibadda@users.noreply.github.com>
Problem: Undo corrupted with 'completeopt' "preinsert" when switching
buffer or window.
Solution: Do not delete preinsert text when switching buffer or window.
(zeertzjq)
related: neovim/neovim#33581closes: vim/vim#171931343681aba
(cherry picked from commit 63689deb45)
Problem: Change applied in d3e495ce uses a byte-offset where a virtual
column is expected.
Solution: Set the cursor directly through a <Cmd> mapping, while making
sure the commands are ordered correctly by adding them to the
type-ahead buffer.
(cherry picked from commit 019b2050e1)
Problem: When switching to another window or tab page while the
completion menu is active, the menu stays visible, although it
belongs to the previous window/tab page context (Evgeni
Chasnovski).
Solution: Track the window and tab page where completion started. Detect
changes in the main editing loop and cancel completion mode if
the current window or tab page differs from where completion
started.
fixes: vim/vim#17090closes: vim/vim#17101cf7f01252f
Co-authored-by: glepnir <glephunter@gmail.com>
Problem:
Neovim disables a number of terminal modes when it exits, some of which
cause the terminal to send asynchronous events to Neovim. It's possible
that Neovim exits before the terminal has received and processed all of
the sequences to disable these modes, causing the terminal to emit one
of these asynchronous sequences after Neovim has already exited. If this
happens, then the sequence is received by the user's shell (or some
other program that is not Neovim).
Solution:
When Neovim exits, it now emits a Device Attributes request (DA1)
after disabling all of the different modes. When the terminal responds
to this request we know that it has already received all of our other
sequences disabling the other modes. At that point, it should not be
emitting any further asynchronous sequences. This means the process of
exiting Neovim is now asynchronous as well since it depends on receiving
the DA1 response from the terminal.
(cherry picked from commit 82f08f33c1)
Problem: When iterating in reverse with {start} > {end} in
`nvim_buf_get_extmarks()`, marks that overlap {start} and are
greater than {end} are included in the return value twice.
Marks that overlap {end} and do not overlap {start} are not
not included in the return value at all. Marks are not
actually returned in a meaningful "traversal order".
Solution: Rather than actually iterating in reverse, (also possible but
requires convoluted conditions and would require fetching
overlapping marks for both the {start} and {end} position,
while still ending up with non-traversal ordered marks),
iterate normally and reverse the return value.
(cherry picked from commit 65170e8dad)
Problem: :set opt1 opt2... emits a separate event for each option.
Solution: Only set the kind for the first printed option value.
(cherry picked from commit 986b92eb07)
Problem: tests: test_mksession does not consider XDG_CONFIG_HOME
Solution: allow to match $HOME/.vim/ and $HOME/.config/vim for &viewdir
(John M Devin)
closes: vim/vim#156395b9237c2e7
Co-authored-by: John M Devin <john.m.devin@gmail.com>
(cherry picked from commit 0eb708aa8a)
Problem: Amiga: default 'viewdir' may not work.
Solution: Use "home:" instead of "$VIM". Add a test. (Christian Brabandt,
closesvim/vim#12576)
b8b1c8ebd4
Cherry-pick Test_mkview_manual_fold() changes from 9.0.{0363,0626}.
Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 827cfe4a76)
Problem: Duplicate check for preinsert effect, particularly for Ctrl_w
and Ctrl_U.
Solution: Remove the specific check for Ctrl_w and Ctrl_U to eliminate
redundancy (glepnir).
closes: vim/vim#171291c2b258250
Co-authored-by: glepnir <glephunter@gmail.com>
(cherry picked from commit f9f6dc4262)
Problem:
`vim.lsp.buf.[implementation|definition|...]({ reuse_win = true })` does not
jump cursor to existing window if buffer is already open.
Steps to reproduce:
1. `nvim repro.lua`
2. Insert anything that lsp can read to open the library definition/implementation, e.g., `vim.keymap.set`
3. open `repro.lua` buffer and the library buffer side by side.
4. type `gd` over `set` to jump to the library definition.
The open buffer is scrolled to the target line, but cursor does not jump.
Solution:
Call nvim_set_current_win if necessary.
(cherry picked from commit 6926fc1615)
Problem:
When a command is not found or not executable, the error message gives
no indication about what command was actually tried.
Solution:
Always append the command name to the error message.
BEFORE:
E5108: Error executing lua …/_system.lua:248: ENOENT: no such file or directory
AFTER:
E5108: Error executing lua …/_system.lua:249: ENOENT: no such file or directory: "foo"
fix#33445
(cherry picked from commit 223ac7782e)
Problem:
When doing paste operation mouse code tries to figure out it it is
dealing with a multi-line register by calling yank_register_mline(),
which fetches register data and checks its type. Later the code calls
either do_put() or insert_reg() which fetch register data again. This is
unnoticeable when working with internal neovim registers, but starts
hurting when dealing with clipboards, especially remote one (forwarded X
or socket tunnel or similar).
Solution:
Change yank_register_mline() to also return pointer to the
register structure prepared for pasting, and insert_reg() to accept
such register pointer and use it if it is supplied. do_put() already
has support for accepting a register structure to be used for pasting.
Fixes#33493
(cherry picked from commit 7432781e71)
Problem: missing out-of-memory check in linematch.c
Solution: return early in case of memory allocation failure, move the
pow() calculation ouside of the for() loop
(John Marriott)
closes: vim/vim#171182137710b43
Co-authored-by: John Marriott <basilisk@internode.on.net>
(cherry picked from commit d2d1b5e944)
Problem: Line number corrected for conceal_lines may be set beyond eob
when the last buffer line is concealed, causing ml_get errors.
Solution: Avoid setting line number beyond eob.
(cherry picked from commit 3341ab0776)
Problem: Computed buffer line for mouse position does not take into
account concealed lines on the reached row.
Solution: Adjust for concealed lines at the end of the loop computing
the buffer position.
(cherry picked from commit 2f8fb4f28a)
Problem:
executability check using `uv.fs_access`
doesn't work currently and can't work on windows
Solution:
only check for executable with `vim.fn.executable`
(cherry picked from commit b8763cb215)
Problem:
:Man shows noisy "ENOENT: no such file or directory" error on Windows.
Solution:
Do some checks before calling `vim.system`.
(cherry picked from commit a8dd5c7e41)
Co-authored-by: Emanuel Krollmann <115734183+Sodastream11@users.noreply.github.com>
Problem: Computed previous buffer line count may be beyond end of
buffer. This results in signs being removed from `b_signcols`
that were never included in it, tripping an assertion.
Solution: Store the previous line count as it was before appending or
deleting lines. Use it to clamp the edited region when
clearing signs before a splice, after which it is reset.
(cherry picked from commit 4a706a7092)
Problem: Lines to/from which virt_lines or inline virt_text may have
moved are left valid. Similarly the modified region may be
too small to account for moved decorations after inserting
or deleting lines. `redrawOneLine()` can be replaced with
a call to `changed_lines_redraw_buf()`.
Solution: Invalidate the line after a change if there is virt_lines, or
inline virt_text in the buffer with 'wrap' enabled. Extend the
modified region for inserted or deleted lines if there may be
decorations in the buffer. Remove `redrawOneLine()`.
Simplify the logic for `changed_lines_invalidate_win()`.
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
(cherry picked from commit 064ff74cdb)
Problem: vim.lsp.buf.hover allows a bold border size which hasn't been
defined
Solution: Define the bold border size for vim.lsp.buf.hover
(cherry picked from commit f068386c9f)
Problem:
Normally, `:drop +41 foo.txt` will open foo.txt with the cursor on line
41. But if foo.txt is already open, it instead is a no-op, even if the
cursor is on a different line.
Steps to reproduce:
nvim --clean foo.txt
:drop +30 foo.txt
Solution:
Handle +cmd in ex_drop().
(cherry picked from commit 3647b821ea)
Problem: Logic computing the new height of the modified area does not
take into account virtual lines attached to a folded line.
Solution: Remove `hasFolding()` branch and let `plines_win_full()` do its job.
(cherry picked from commit 5b1561bb71)
Problem: Help files not detected when 'iskeyword' includes ":".
Solution: Do not use \< and \> in the pattern (zeertzjq).
fixes: vim/vim#17069closes: vim/vim#17071e370141bf4
(cherry picked from commit 8af9f8ab5e)
Problem: An on_win-disabled decoration provider is left disabled for
the on_buf callback during the next redraw (if the provider
does not subscribe to on_end).
Solution: Move re-activation of the provider from after the on_end
callback to before the on_start callback.
(cherry picked from commit ca16b54c86)
Problem:
As `:h kp` says, the default value for keywordprg
should be ':help' on Windows. It is currently
always ':Man'.
Solution:
Add condition to options.lua which sets keywordprg
to ':help' if running on windows.
(cherry picked from commit 3ebde5ea14)
Problem:
nvim_buf_del_extmark error if buffer is destroyed before timer stops
Solution:
check nvim_buf_is_valid.
(cherry picked from commit 28e8190185)
Problem: Successive autocmd verbose messages may be emitted without a kind.
Solution: Always set the kind when preparing to emit a verbose message.
(cherry picked from commit 98f5aa2564)
Problem: completion: in keyword completion Ctrl_P cannot go back after
Ctrl_N
Solution: in find_compl_when_fuzzy() always return first match of array, after Ctrl_P
use compl_shown_match->cp_next instead of compl_first_match.
(glepnir)
closes: vim/vim#170433e50a28a03
Co-authored-by: glepnir <glephunter@gmail.com>
(cherry picked from commit b01921cb55)
Problem: compl_shown_match is updated when starting keyword completion
and does not include fuzzy matching.
Solution: Do not update compl_shown_match when starting keyword
completion, since it is the one already selected by the
keyword completion direction. (glepnir)
closes: vim/vim#17033e4e4d1c381
Co-authored-by: glepnir <glephunter@gmail.com>
(cherry picked from commit 8cf413e450)
Problem: When running functional tests locally, test `syntax/shada.vim works`
fails if the local timezone is not a whole number of hours ahead of UTC.
Solution: Use '!%M' for minute format so that UTC is used in the expected
timestamp instead of the local timezone, just like '%H' for hours.
(cherry picked from commit d9405c7935)