PROBLEM:
Whenever any text edits are applied to the buffer, the `marks` part of those
lines will be lost. This is mostly problematic for code formatters that format
the whole buffer like `prettier`, `luafmt`, ...
When doing atomic changes inside a vim doc, vim keeps track of those changes and
can update the positions of marks accordingly, but in this case we have a whole
doc that changed. There's no simple way to update the positions of all marks
from the previous document state to the new document state.
SOLUTION:
* save marks right before `nvim_buf_set_lines` is called inside `apply_text_edits`
* check if any marks were lost after doing `nvim_buf_set_lines`
* restore those marks to the previous positions
TEST CASE:
* have a formatter enabled
* open any file
* create a couple of marks
* indent the whole file to the right
* save the file
Before this change: all marks will be removed.
After this change: they will be preserved.
Fixes#14307
Problem: Stray character is visible if 'smoothscroll' marker is displayed
on top of a double-wide character.
Solution: When overwriting a double-width character with the 'smoothscroll'
marker clear the second half. (closesvim/vim#12469)
ecb87dd7d3
Problem: Cursor ends up below the window after a put.
Solution: Mark w_crow and w_botline invalid when changing the cursor line.
(closesvim/vim#12465)
8509014add
Co-authored-by: Bram Moolenaar <Bram@vim.org>
If the server sends the positionEncoding capability in its
initialization response, automatically set the client's offset_encoding
to use the value provided.
Problem: Line pointer becomes invalid when using spell checking.
Solution: Call ml_get() at the right places. (Luuk van Baal, closesvim/vim#12456)
e84c773d42
BREAKING CHANGE: LspRequest is no longer a User autocmd but is now a
first class citizen.
LspRequest as a User autocmd had limited functionality. Namely, the only
thing you could do was use the notification to do a lookup on all the
clients' requests tables to figure out what changed.
Promoting the autocmd to a full autocmd lets us set the buffer the
request was initiated on (so people can set buffer-local autocmds for
listening to these events).
Additionally, when used from Lua, we can pass additional metadata about
the request along with the notification, including the client ID, the
request ID, and the actual request object stored on the client's
requests table. Users can now listen for these events and act on them
proactively instead of polling all of the requests tables and looking
for changes.
Problem: Incsearch not triggered when pasting clipboard register on the
command line.
Solution: Also set "literally" when using a clipboard register. (Ken Takata,
closesvim/vim#12460)
9cf6ab1332
Co-authored-by: K.Takata <kentkt@csc.jp>
- `client.dynamic_capabilities` is an object that tracks client register/unregister
- `client.supports_method` will additionally check if a dynamic capability supports the method, taking document filters into account. But only if the client enabled `dynamicRegistration` for the capability
- updated the default client capabilities to include dynamicRegistration for:
- formatting
- rangeFormatting
- hover
- codeAction
- hover
- rename
Problem: SpellCap highlight not always updated when needed.
Solution: Handle updating line below closed fold and other situations where
only part of the window is redrawn. (Luuk van Baal, closesvim/vim#12428,
closesvim/vim#12420)
2ac6497f0e
fixes#23734
Get rid of the weird attr_pri dance which always seemed like a kludge:
if (!attr_pri) {
wlv.char_attr = hl_combine_attr(wlv.char_attr, extmark_attr);
} else {
wlv.char_attr = hl_combine_attr(extmark_attr, wlv.char_attr);
}
Instead combine extmark attrs with (old-skool) syntax attrs in a consistent way and then combine that with attr_pri and the rest in an _unified_ code path
fixes#23722
Co-authored-by: luukvbaal <luukvbaal@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem: Bad redrawing with spell checking, using "C" and "$" in 'cpo'.
Solution: Do not redraw the next line when "$" is in 'cpo'. (closesvim/vim#11285)
f3ef026c98
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: With spell checking, deleting a full stop at the end of a line
does not update SpellCap at the start of the next line.
Solution: Update the next line when characters have been deleted. Also when
using undo.
26f09ea54b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: After exiting Insert mode spelling is not checked in the next
line.
Solution: When spelling is enabled redraw the next line after exiting Insert
mode in case the spell highlight needs updating.
ee09fcc9b6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Spell checking for capital not working with trailing space.
Solution: Do not calculate cap_col at the end of the line. (Christian
Brabandt, closesvim/vim#10870, issue vim/vim#10838)
afa23d1b99
Co-authored-by: Christian Brabandt <cb@256bit.org>
libvterm v0.3 supports reflow of terminal buffer when Nvim is resized
Since v0.3 is now a required dependency, enable it by default to find
(and fix) possible issues.
Note: Neovim's scrollback buffer does not support reflow (yet), so lines
vanishing into the buffer due to a too small window will be restored
without reflow.
This ensures that colorschemes in 'rtp' are tried before ones in 'pp',
because some colorschemes in 'pp' may not work if not added to 'rtp'.
This also match the current documentation better.
Problem: In diff mode virtual text is highlighted incorrectly. (Rick Howe)
Solution: Do not use diff attributes for virtual text. (closesvim/vim#11714)
d097af7779
Co-authored-by: Bram Moolenaar <Bram@vim.org>