Following is a list of commits (fixes/features only) in this release.
See `:help news` in Nvim for release notes.
FEATURES
--------------------------------------------------------------------------------
- 693772100e help: gx opens help tag in web browser (#35784)
- f9cad88d5a vimscript: log function name in "fast" message #32616
PERFORMANCE
--------------------------------------------------------------------------------
- 4c8486e1f2 scheduler priority clamping on macOS #35488
- 0f6a180bcc api: reduce redundant `win_find_tabpage` calls (#35643)
FIXES
--------------------------------------------------------------------------------
- 4e4428dee8 vim.lsp.omnifunc should not throw away other items #35346
- f2fb46ef9e api: nvim_open_win default to half-size for splits (#36088)
- 479bb9cbab api: nvim_open_win respects requested split window size (#35601)
- 5aa6257e8c api: win_set_config error message for splitting from a float #35650
- 66b8018b06 channel: closing socket with pending writes leaks memory (#36400)
- 3237f634fa cjson: fix `strbuf_set_length` incorrectness #35565
- 95cc67538b clipboard: avoid using stale register width (#36178)
- d31953d532 diagnostics: extend conversion support from/to quickfix format (#34006)
- 7304fc275e excmd: :trust executed even when inside false condition (#36032)
- 0e1c83fae2 filetype: handle invalid `bufnr` in _getlines(), _getline() #36272
- 86b2c0f201 float: crash from nasty :fclose autocmds (#36137)
- d8a7c86e73 health: errors in :checkhealth with pyenv-virtualenv #35865
- 8e00534b1e health: hard fail on invalid "python-*" bin #35382
- 2668a46902 lsp: "attempt to index nil config" #36189
- 21540d21ca lsp: _get_workspace_folders does not handle root_dir() function (#36141)
- 14e74d98fd lsp: misleading logs in non-applicable filetypes #35749
- a7eb110098 lsp: noisy log message when enabling server without config #36264
- eb4837206a lsp: restore Client:stop() force-stopping behavior (#35800)
- 556d8d0002 lsp: treat 2-triggers-at-once as "last char wins" #35435
- 7b1ac2080d lua: don't leak handle when vim._watch.watch() fails (#35768)
- c84ba83cf1 options: increase t_Co buffer size (#35859)
- 7aea000343 paste: don't use :echo immediately before :redraw (#35773)
- 47f6f21998 plines: count 'showbreak' in EOL inline virt_text in line size (#35921)
- 4338eea269 rpc: handle more cases when identifying loopback #36100
- d399ed310e socket: avoid stack-use-after-return after timeout (#36405)
- 4cc060bf44 statusline: redraw if Visual selection other end changes (#36281)
- 7f5427b857 terminal: add various missing redraws
- d78d5cf1aa terminal: adjust marks when deleting scrollback lines (#36294)
- f3f6705075 terminal: avoid events messing up topline of focused terminal
- 8c5bc4920a terminal: avoid tailed cursor in focused terminal in events
- 934d28558d terminal: check size when creating new tabpage
- e67fec1541 terminal: deleting from wrong buffer (#36289)
- e4db5edb8a terminal: don't trigger TextChangedT for unrelated redraws
- 854b319060 terminal: handle OSC 8 split into multiple fragments
- a6d8f40b64 terminal: keep last cursor if it's on the last row
- 46d68e5290 terminal: patch various autocommand-related holes
- 5ee9e3f258 terminal: possibly wrong wrow/wcol in active terminal
- b21ec366b9 terminal: remove condition that buf is curbuf (#33721)
- 2eea65fe68 terminal: update winopts and focus when switching terminals
- 169dc60a44 terminal: wrong row in TermRequest with full scrollback (#36298)
- 8f05fdbfb3 tests: ignore vector math types
- 924a8e4238 tui: don't wait for DA1 response when stdin is closed (#35745)
- 07184aa973 tui: handle sequence larger than entire buffer
- 1c8805e3b2 vim.json: fix truncation of decoded numbers outside lua_Integer's range #35702
- 8c311386c3 window: don't add a hsep when out of room if global stl is off
VIM PATCHES
--------------------------------------------------------------------------------
- dd79bc8360 014c731: runtime(doc): make :h virtcol() more accurate (#35976)
- c2a3838ab2 8.1.0636: line2byte() gives wrong values with text properties
- a0dac399d0 8.1.1681: insert stray "{" when listener gets buffer line
- d573ffcfc7 8.1.1700: listener callback called for the wrong buffer
- 7159a0192b 8.1.1711: listener callback called at the wrong moment
- b6dd8bbca0 8.1.2008: error for invalid range when using listener and undo
- 03f9df8117 8.2.0115: byte2line() does not work correctly with text properties
- d1a0d0889b 8.2.0844: text properties crossing lines not handled correctly
- 9b5545103e 8.2.0853: ml_delete() often called with FALSE argument
- c8912d7329 8.2.3348: line2byte() returns wrong value after adding textprop
- b0ed4a3cb8 8.2.3795: too many #ifdefs
- e4bbe09dcc 8.2.4379: an empty change is reported to a listener
- 5c6ea43da8 80981e1: runtime(doc): mention 'findfunc' at :h :find (#35697)
- 8634a46165 9.1.0689: [security]: buffer-overflow in do_search() with 'rightleft'
- a839200c0a 9.1.0695: tests: test_crash leaves Untitled file around
- 61aab4cfe0 9.1.0698: tests: "Untitled" file not removed when running Test_crash1_3 alone
- 85e4503f18 9.1.1754: :helptags doesn't skip examples with syntax
- 77fe01f200 9.1.1773: Crash in BufLeave after BufUnload closes other windows (#35830)
- 7e724dfa2f 9.1.1780: mbyte contains overlapping list of utf_classes table (#35869)
- 4db62d96bc 9.1.1798: Wrong display with 'sms' and long wrapped virt text at EOL (#35930)
- 9c09983068 9.1.1802: 'nowrap' in a modeline may hide malicious code (#35946)
- 67688ab616 9.1.1807: :set doesn't clear local insecure flag like :setlocal does
- 6dda8e9572 9.1.1808: Option insecure flags not copied when splitting window
- ac48d9c3c9 9.1.1823: diff: w_topline may be invalidated (#36018)
- e1fe0ed2df 9.1.1831: stray vseps in right-most 'winfixwidth' window
- d21c23b8c9 9.1.1836: 'culopt' "screenline" not redrawn with line("w0") and :retab
- aab8134f87 9.1.1839: Window may have wrong height if resized from another tabpage (#36093)
- ad172eb762 9.1.1858: v:register not reset after Visual mode command (#36215)
- a4319015ee 9.1.1868: v:register is wrong in v_: command (#36238)
- 8928ede8af 9.1.1870: :Tutor may not work as expected (#36343)
- 1b27d8f428 9.1.1871: Wrong 'showcmd' in the cmdwin (#36320)
- a2d4a0fda9 9.1.1885: Wrong restored cursor pos when re-entering buffer after changes
- 7790dca2eb 9.1.1891: g<End> does not move to last non-blank in visual mode (#36354)
- 88ff561dcc 9.1.1893: ICCF charity will dissolve (#36427)
- 19d58cb2cc a0f37db: runtime(doc): use a single pattern in :h 'incsearch' example (#35721)
- 8ed1ef1377 partial:9.0.0323: using common name in tests leads to flaky tests
CI
--------------------------------------------------------------------------------
- e415fae42e Windows arm64 packages #35345
Problem: In visual mode, g<End> does not move to the last non-blank
character when the end of a line is on the same line as the
cursor (after v9.0.1753)
Solution: Move the cursor back by one position if it lands after the
line (varsidry)
fixes: vim/vim#18657closes: vim/vim#18658adc85151f3
(cherry picked from commit b92b95e2c2)
Problem:
In socket_connect(), if connecting to the given TCP address times out,
libuv is still trying to connect to the address, and connect_cb may be
called when running the libuv event loop after the `status` variable
referenced by `req.data` goes out of scope.
Solution:
Close the uv_tcp_t handle and wait for connect_cb to be called before
retrying or failing in socket_connect(). This also avoid leaking libuv
handles.
The tests added here only check that the non-timeout case still works,
as checking the timeout case is very hard without modifications to the
code. Removing the first LOOP_PROCESS_EVENT_UNTIL() in socket_connect()
(the one with the timeout) is a way to check that manually.
Also add a comment about the cause of the ASAN error in #34586.
Problem: Closing socket with pending writes leaks memory.
Analysis: When calling rstream_may_close() on an RStream with pending
writes, it waits for write_cb() to call stream_close_handle(),
which closes it as if it's a WStream and doesn't free the
RStream's buffer.
Solution: Ensure that an RStream's buffer is freed when it's closed.
Problem: Wrong restored cursor position when re-entering a buffer
previously viewed in a window after making changes to the same
buffer in another window.
Solution: Adjust per-window "last cursor" positions on buffer changes.
(zeertzjq)
closes: vim/vim#18655b2e6b328da
Problem: TextChangedT fires depending on whether Nvim needs to update_screen
while in terminal mode. This makes little sense as redraws can be completely
unrelated to the terminal. Also, TextChanged could be fired from changes in
terminal mode after returning to normal mode.
Solution: trigger it when b:changedtick changes, like other such events. Happens
when invalid cells are refreshed, though is no longer affected by cursor
changes. Don't fire TextChanged from changes in terminal mode after leaving.
Unlike the other TextChanged* events, I've elected to not have it be influenced
by typeahead. Plus, unlike when leaving insert mode when no TextChangedI events
are defined, I don't trigger TextChanged when returning to normal mode from
changes in terminal mode (is that a Vim bug?)
Curiously, Vim's TextChangedT is different; it's tied to its terminal cursor
redraws, which triggers pretty eagerly (but is unaffected by unrelated redraws)
- usually *twice* when data is sent to the terminal (regardless of whether it
causes any visible changes, like incomplete escape codes; wasn't true for Nvim).
Not clear to me how this event was actually intended to work, but this seems to
make the most sense to me.
Problem: w_wrow/col calculation in terminal_check_cursor is wrong when the
terminal is smaller than the window. Common when there's a larger window open
with the same terminal, or just after a resize (as refresh_size is deferred).
Solution: don't calculate it; validate_cursor will correct it later if it's
out-of-date.
Note that the toplines set for the terminal (also before this PR) assume
'nowrap' (which is set by default for terminal windows), and that no weird stuff
like filler lines are around. That means, for example, it's possible for the
cursor to be moved off-screen if there's wrapped lines. If this happens, it's
likely update_topline will move the cursor back on screen via validate_cursor or
similar, but maybe this should be handled more elegantly in the future?
Problem: autocommands can cause various problems in terminal mode, which can
lead to crashes, for example.
Solution: fix found issues. Move some checks to terminal_check and guard against
autocommands messing with things. Trigger TermEnter/Leave after terminal mode
has changed/restored most state. Wipeout the correct buffer if TermLeave
switches buffers and fix a UAF if it or WinScrolled/Resized frees the terminal
prematurely.
These changes also allow us to remove the buffer restrictions on TextChangedT;
they were inadequate in stopping some issues, and WinScrolled/Resized was
lacking them anyway.
Problem: when creating a new tabpage with a terminal window, terminal size is
not updated if there is no statusline.
Solution: do not rely on last_status to implicitly call terminal_check_size as a
side effect of making room for a statusline; call it directly.
Problem: topline of a focused terminal window may not tail to terminal output if
events scroll the window.
Solution: set the topline in terminal_check_cursor.
Problem: missing redraws when restoring saved cursorline/column, plus missing
statusline and mode redraws when not updating the screen in terminal mode.
Solution: schedule the redraws in a similar manner to other modes and remove
some now unnecessary redrawing logic. Redraw if cursorline-related options
change from entering terminal mode. This fixes test failures in later commits.
WTF: TextChangedT triggers based on must_redraw, which is... fun...? Try to
preserve its behaviour as much as we can for now.
Problem: in terminal mode, adjust_topline moves curwin's cursor to the last row
so set_topline tails the non-scrollback area. This may result in the observed
cursor position remaining tailed in events within the focused terminal, rather
than reflecting the actual cursor position.
Solution: use the focused terminal's actual cursor position immediately, rather
than relying on the next terminal_check_cursor call in terminal_check to set it.
Note: Maybe also possible for terminal mode cursor position to be stale
(reporting the normal mode position) when switching buffers in events to another
terminal until the next terminal_check call? (or until refresh_terminal is
called for it) Maybe not worth fixing that, though.
**Problem:**
`vim.filetype.match({ filename = 'a.sh' })` returns `nil` because
an invalid buffer ID is passed to `vim.api.nvim_buf_get_lines()`.
For filetypes like `csh`, `txt`, or any other extensions that call
`_getlines()` or `_getline()` to detect their filetypes, the same
issue occurs.
When only the `filename` argument is passed, an error is raised
inside a `pcall()` that wraps the filetype detection function,
causing it to return no value without showing any error message.
**Solution:**
Validate the `bufnr` value in `_getlines()` and `_getline()`.
(cherry picked from commit 095b9f98f3)
Problem: Wrong row in TermRequest with full scrollback.
Solution: Subtract by the number of lines deleted from scrollback.
(cherry picked from commit 67832710a5)
Follow-up to #33721.
This doesn't seem to affect actual behavior for now, as these two lines
seem only reachable when the 'scrollback' option is changed, and options
can currently only be changed in the current buffer.
(cherry picked from commit 459cffc55f)
Problem: ml_delete() often called with FALSE argument.
Solution: Use ml_delete_flags(x, ML_DEL_MESSAGE) when argument is TRUE.
ca70c07b72
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: line2byte() returns wrong value after adding textprop. (Yuto
Kimura)
Solution: Reduce the length by the size of the text property. (closesvim/vim#8759)
14c7530c4f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Text properties crossing lines not handled correctly.
Solution: When saving for undo include an extra line when needed and do not
adjust properties when undoing. (Axel Forsman, closesvim/vim#5875)
ML_DEL_UNDO, ML_APPEND_UNDO are no-opt because textprop feature is N/A.
a9d4b84d97
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: An empty change is reported to a listener.
Solution: Do not report an empty change. (closesvim/vim#9768) Remove unused
return value.
55737c2a31
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Error for invalid range when using listener and undo. (Paul Jolly)
Solution: Do not change the cursor before the lines are restored.
(closesvim/vim#4908)
4544bd2f24
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Byte2line() does not work correctly with text properties. (Billie
Cleek)
Solution: Take the bytes of the text properties into account.
(closesvim/vim#5334)
9df53b62de
Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 7048c36ba8)
Problem: Listener callback called at the wrong moment
Solution: Invoke listeners before calling ml_delete_int(). (closesvim/vim#4657)
acf7544cf6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 750c350be8)
Problem: Listener callback called for the wrong buffer.
Solution: Invoke listeners before calling ml_append_int().
250e3112c6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit c9b35360ac)
This warning doesn't really make sense, since the `enable()` call is
meant to be run before the `lsp.config` calls. It will be logged many
times (once for each enabled LSP) at startup.
This is especially annoying because calling `enable()` after
configuration causes the first opened buffer not to have its filetype
set in some situations. This is a separate bug which really needs to be
fixed, and makes this superfluous logging more likely.
(cherry picked from commit 3c4acc0f1a)
Problem: v:register is wrong in v_: command (after 9.1.1858).
Solution: Don't reset v:register for OP_COLON (zeertzjq)
related: https://github.com/vim/vim/pull/18583#issuecomment-3418030021closes: vim/vim#185970124320c97
While at it, also fix using stale set_prevcount value. That only matters
when readbuf1 ends with an operator or a register, which never happens,
but it's still good to avoid using a stale value.
(cherry picked from commit 68a54bfda6)
Problem: v:register not reset after Visual mode command.
(laktak)
Solution: Reset v:register if Visual mode was active before
do_pending_operator() (zeertzjq)
fixes: vim/vim#18579
related: vim/vim#5305closes: vim/vim#18583b3b47e540d
(cherry picked from commit aeeadddac4)
Problem:
If a client doesn't have a config then an error may be thrown.
Probably caused by: 2f78ff816b
Lua callback: …/lsp.lua:442: attempt to index local 'config' (a nil value)
stack traceback:
…/lsp.lua:442: in function 'can_start'
…/lsp.lua:479: in function 'lsp_enable_callback'
…/lsp.lua:566: in function <…/lsp.lua:565>
Solution:
Not all clients necessarily have configs.
- Handle `config=nil` in `can_start`.
- If user "enables" an invalid name that happens to match a *client*
name, don't auto-detach the client.
(cherry picked from commit bf4710d8c3)