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)
Problem: Currently vim.hl.range only allows one timed highlight.
Creating another one, removes the old one.
Solution: vim.hl.range now returns a timer and a function. The timer
keeps track of how much time is left in the highlight and the function
allows you to clear it, letting the user decide what to do with old
highlights.
(cherry picked from commit eae2d3b145)
Problem: `severity` field is recognized by
`vim.diagnostic.Opts.VirtualLines`, but it is not explicitly
documented.
Solution: document it.
(cherry picked from commit 71e133e5e6)
Problem: Redrawing during a substitute confirm prompt causes the match
highlight to disappear.
Solution: Unset `highlight_match` after the prompt has returned.
Use global highlight definitions in searchhl_spec.lua.
(cherry picked from commit 3af43cffa0)
Problem: When `nvim_set_keymap` tries to overwrite a `<unique>` mapping,
it throws an error even when called in `pcall`.
Solution: src/nvim/mapping.c:buf_do_map no longer calls `semsg`. Its
callers now decide whether to ignore the error, or use
`semsg` (not caught)/`api_set_error` (caught by `pcall`).
(cherry picked from commit ec18ebcb41)
Problem:
If a config name contains "*" it causes rtp discovery of `lsp/` to
consider the `*` as a wildcard and could lead to strange and unintended
behaviour. For example, accessing the `'*'` config from a `lsp/` file
would cause an infinite loop.
Solution:
- Explicitly disallow a config name from containing wildcards, with the
exception of `'*'`.
- When Resolving `'*'` config, skip the rtp step.
(cherry picked from commit 2ee896201c)
Problem: Negative window and grid height with 'winbar'.
Solution: Clamp the height when subtracting the 'winbar' height.
(cherry picked from commit 0e7479bb76)
These occurrences also accept string, which is used like in getline.
Also make the lnum field of vim.fn.sign_placelist.list.item optional, as it can
be omitted like vim.fn.sign_place.dict's.
(cherry picked from commit 4a36f234ac)
Problem: Scrolling up does not adjust `w_topline` for concealed lines
directly above it, resulting in (non-visual) asymmetry when
scrolling up/down.
Solution: Adjust `w_topline` for concealed lines after scrolling up.
(cherry picked from commit 32325a66ca)
Problem: Inline virtual text placed in a decor provider callback
invalidates `w_virtcol`, which must be valid for `win_line()`.
Solution: Call `validate_virtcol()` after "line" decor provider callbacks.
(cherry picked from commit 7e8b7bba21)
Problem: repeated gO in markdown etc. adds extra toc indentation
Solution: don't memoize heading table which gets modified
(cherry picked from commit 28eaec5e15)
Problem:
:terminal shell prompt jump mappings ]]/[[ don't work in visual mode.
Solution:
Also define them for in visual mode.
(cherry picked from commit cb247e06f0)
Co-authored-by: msaher <77233589+msaher@users.noreply.github.com>
Problem:
Nvim needlessly requests inlay_hints even if they are disabled for a given buffer.
Solution:
Add the missing `enabled` check in `on_refresh`.
Rest of the code has this check already so that's the only needed one to fix this.
(cherry picked from commit 49756ebc70)