4772 Commits

Author SHA1 Message Date
Justin M. Keyes
5ddb4b672e fix(ui2): "msg_history_show" error while in cmdwin
Problem:
Executing :messages while in cmdwin fails:

    Error in "msg_history_show" UI event handler (ns=nvim.ui2):
    Lua: …/_core/ui2/messages.lua:699: Invalid 'height': expected positive Integer
    stack traceback:
    [C]: in function 'nvim_win_set_config'
    …/_core/ui2/messages.lua:699: in function 'set_pos'
    …/_core/ui2/messages.lua:329: in function 'set_target_pos'
    …/_core/ui2/messages.lua:389: in function 'show_msg'
    …/_core/ui2/messages.lua:553: in function 'handler'
    …/_core/ui2.lua:161: in function 'ui_callback'
    …/_core/ui2.lua:210: in function <…/_core/ui2.lua:202>

The bug: when `texth.all` is small (e.g. 0 from a hidden pager whose new
content isn't laid out yet), or when the available height after
subtracting the cmdwin is small, `math.min(min, …)` can yield 0, and
`nvim_win_set_config` rejects `height=0`.

Solution:
Floor at 1.
2026-06-25 18:36:24 +02:00
Justin M. Keyes
b2bf7bcfb1 feat(cmdwin): implement cmdwin as a normal buf+win
Problem:

cmdwin (the `:q` cmdline buffer) has various limitations which require
special-casing all over the codebase.

Besides complicating the code, it also breaks async plugins if they try
to create buffers/windows after some work is done, if the user happens
to open cmdwin at the wrong the moment:

    Lua callback: …/guh.nvim/lua/guh/util.lua:531:
    E11: Invalid in command-line window; <CR> executes, CTRL-C quits
    stack traceback:
        [C]: in function 'nvim_buf_delete'
        …/guh.nvim/lua/guh/util.lua:531: in function <…/guh.nvim/lua/guh/util.lua:526>

Solution:

Just say no to "inception". Reimplement cmdwin as a normal buffer+window.

All of the cmdwin contortions (in both core, and innocent plugins) exist
literally only to support "inception": recursive
cmdwin-in-cmdline-things, like `<c-r>=`, `/`, search-during-substitute,
`:input()`, etc. So we just won't support that (though I have
a potential plan for that later, which I call "modal parking lot").

The benefit is that plugins, and core, no longer have to care about
cmdwin.

BONUS:
- mouse-drag on vertical separators works (it only worked for
  horizontal/statusline before)
- inccommand-in-cmdwin now works correctly, for free (thus don't need
  #40077).

POTENTIAL FOLLOWUPS
- Drop `CHECK_CMDWIN` ("E11: Invalid in command-line window"), allow chaos.
- Unify `BUFLOCK_OK` / `LOCK_OK` ?

DESIGN:
- Eliminate lots of C globals, `EX_CMDWIN`, etc.
- `text_locked()` no longer reports true for cmdwin.
- cmdwin = a normal window with 'winfixbuf', 'bufhidden=wipe',
  'buftype=nofile'. Invariants come from those options rather than
  special cases throughout the codebase.
- `nv_record` for q:/q//q? calls Lua
  `nlua_call_vimfn("vim._core.cmdwin", …)`. No `K_CMDWIN`
  / cmdline-reader detour.
- `cedit_key` (`c_CTRL-F`) schedules a deferred event that calls
  `vim._core.cmdwin.open(type, content, pos)` and returns `Ctrl_C` so
  the in-flight cmdline cancels. Reader state is not serialized; instead
  the captured `(type, line, col)` is replayed via
  `nvim_feedkeys(type..line.."<CR>", "nt", …)` after user confirms.
- On confirm/cancel: `<CR>` / `<C-C>` calls into Lua which closes the
  window and re-feeds the cmdline.

BREAKING CHANGES:
- Expression-register cmdline (`<C-R>=` from insert-mode) no longer
  supports cmdwin. Same applies to `input()` / `inputlist()` (already
  covered by `text_locked`).
- Usage of cmdwin in macros/mappings will probably break (assuming they
  ever worked).
2026-06-25 18:36:24 +02:00
Dmytro Meleshko
bcfc2037ef perf(treesitter): reduce memory usage of _select.lua #40409
Problem:  The table `history` in treesitter/_select.lua stores references
          to previously selected TSNodes, but a TSNode needs to keep its
          whole TSTree alive in memory, which may be kept alive even
          after closing the buffer to which this history corresponds.

Solution: Store just the bits of information from the TSNode we need to
          go back in selection history (the range and ID), without
          referencing the TSNode itself.
2026-06-25 11:46:26 -04:00
Dmytro Meleshko
9afa8477b3 fix(treesitter): incremental selection causes beeps when the bell is enabled #40414
Problem:  The function visual_select() in treesitter/_select.lua is
          executing `:normal! v<Esc>` to ensure that `gv` later goes
          back to character Visual mode, but doing so when mode() is
          already `v` first switches back to the Normal mode, then
          executes <Esc>, which causes a beep.
Solution: Check if the mode() is already `v` and avoid any switching in
          that case.
2026-06-25 11:36:24 -04:00
Barrett Ruth
4d9e5acfb5 fix(lsp): skip invalid file watcher globs #40376 #40396
Some servers register `workspace/didChangeWatchedFiles` watchers for URI
schemes that cannot be watched locally. Skipping the unsupported glob
and keep the rest of the registration batch active.
2026-06-25 03:44:33 -04:00
jdrouhard
3c924d13fe fix(lsp): fire LspNotify didChange autocmds after undo/redo #40404
Problem: LspNotify autocmds were not being triggered for didChange
requests when being used during undo/redo (and possibly other) actions.
autocmds are blocked when calling on_lines() callbacks while doing the
undo/redo action.

Solution: Defer firing the autocmd until after the action is complete.
This is closer to what existed before, but now there's a check in the
deferred function to only fire the autocmd if the client is still
active and the buffer is still attached, if applicable.
2026-06-25 03:37:39 -04:00
Barrett Ruth
8bf7fc810a fix(tty): filter terminal probes by channel #40356
Problem:
Terminal probes sent with `nvim_ui_send()` can reach more than one stdout TTY
UI. Probes with a known TTY UI owner should not accept `TermResponse`s from
unrelated UI channels. 

Solution:
Thread the existing `chan` filter through owned terminal probes. This covers
startup/attach background detection, fallback truecolor detection, and
`vim.tty.query()` forwarding opts to `vim.tty.request()`.

Note: Not every terminal escape path is updated here. I only passed `chan` when
the caller already knows which TTY UI owns the probe. For example, this does
not include:
- (Followup) OSC 52 (system clipboard) detection. It needs to capture the
  `UIEnter` channel. Adding `{ chan = ... }` only to the nested query would be
  half a fix.
- OSC 52 _paste_ is left global because the provider callback does not have
  a UI channel (paste is invoked without a ui channel/tty ui object).
2026-06-24 10:40:36 -04:00
Justin M. Keyes
8e3b216d0b docs: bufadd(), fnameescape() guidance #40378 2026-06-23 10:08:50 -04:00
Barrett Ruth
db30608058 fix(tui): attribute TermResponse to source channel #40330
Problem: Attach-time terminal probes cannot distinguish responses from
different attached UIs.

Solution: Identify the UI by RPC channel id in `TermResponse` and make
`vim.tty.request()` filter responses by channel.
2026-06-23 06:19:56 -04:00
Luuk van Baal
e542b42903 fix(ui2): message before empty prompt not shown
Problem:  Message before empty input() is not visible.
Solution: Route to dialog window with active prompt (hl_id >= 0).
2026-06-22 15:56:26 +02:00
Luuk van Baal
60a46036c0 fix(ui2): clear search_count after clearing the screen
Problem:  Clearing the screen doesn't clear the "last" virtual text.
          Dupe counter virtual text is not increased beyond 1.
Solution: Clear "last" virtual text when clearing the screen.
          Restore assignment lost in a previous commit.
2026-06-22 15:14:53 +02:00
Barrett Ruth
74f163c67d fix(defaults): detect 'background'/'termguicolors' on UI attach #40175
Problem:  Terminal background and truecolor detection runs only at startup,
          gated on a UI being attached. A headless server has no UI then, so
          `'background'` and `'termguicolors'` are never detected and remote
          UIs ignore the terminal's theme.
Solution: Also (re)detect on UIEnter. The most recently attached terminal
          wins; an explicit user value is preserved.
2026-06-20 20:09:34 -04:00
Justin M. Keyes
9caef3a2f4 fix(health): check more "old" files 2026-06-20 19:55:29 +02:00
luukvbaal
9618032936 perf(ui2): accumulate message lines #40338
Problem:  Writing a message with a large number of newlines
          (:echo "foo\n"->repeat(1000000)) takes longer than it has to
          (since c973c7ae).
Solution: Accumulate newlines in a single API call when possible.
2026-06-20 13:01:58 -04:00
jdrouhard
54188fa242 fix(lsp): make LspNotify more robust #40332
Problem: LspNotify never passed a buffer when executing the autocmds, so
buffer-local LspNotify autocmd subscriptions didn't have the correct buf
in the event metadata. It was also wrapped in a schedule() so the actual
autocmd was delayed until after the event loop.

This could result in the wrong buffer receiving the notification if
multiple LspNotify autocmds with buffer filters were added. Only the
"latest" one would actually receive non-buffer-filtered autocmds, not
the matching one. It also caused listeners to receive the notification
"out of sync" with when the notification is actually sent. If a buffer
is being deleted (which fires a textDocument/didClose notification), the
notification is scheduled and fired after the buffer is already gone.

Solution: For LSP notifications that pertain to a particular buffer, set
it when executing the LspNotify autocmds so the callback functions that
are filtered on that buffer will get the correct notifications and the
metadata buf field will be correct. Additionally, there is no need to
wrap the LspNotify callback in vim.schedule when it can be called inline
when the notification to the rpc server is fired.

This is tested by removing now-unnecessary autocmds from semantic tokens
(InsertEnter and BufWinEnter should no longer be necessary now that
requests are fired by LspNotify). Without this fix, simply modifying a
buffer doesn't actually trigger LspNotify correctly, and the test for
that fails.
2026-06-20 12:46:58 -04:00
jdrouhard
6bc6461eac fix(lsp): multiline semantic token processing #40339
Problem: When multiline semantic token support was introduced, the loop
that finds the end line for a particular token didn't sanitize the token
length sent back by the LSP server. If the server returned an overflowed
length (near uint32 max), neovim would burn cpu and loop for an
extremely long time while trying to find the "end line" represented by
the massively large token, causing neovim to seemingly hang.

Solution: Stop looping once the calculated end_line reaches the actual
last line of the buffer.

Fixes #36257
2026-06-20 10:51:21 -04:00
luukvbaal
69160854c5 feat(column): per row click handlers for 'statuscolumn' (#40265)
Problem:
- Current 'statuscolumn' click label caveat is restrictive.
- v:virtnum is not unique to a line if it has both above and
  below virtual lines.
- 'statuscolumn' click handler may expect v:virt/lnum to be set.

Solution:
- Store per-row click definitions for the statuscolumn in a
  (nested line/virt number) map.
- Implement strategy that gives each 'statuscolumn' row a unique
  v:virtnum.
- Set v:virt/lnum when determining which line is clicked.
2026-06-20 15:59:08 +02:00
jdrouhard
b5181300ae refactor(lsp): refactor linked_editing_range to use vim.lsp._capability (#40327)
Problem: linked_editing_range was still doing most of the capability
boilerplate itself.

Solution: refactor it to make use of the common Capability framework for
handling enabling, disabling, etc.
2026-06-19 10:42:14 -07:00
zeertzjq
1e30f5d242 fix(:checkhealth): open after current tabpage (#40319) 2026-06-19 17:45:21 +08:00
Nathan Zeng
ae426ee465 feat(:restart): v:startreason #40186
Problem:
It's clumsy for scripts to handle a "restart", without custom mappings or
global vars.

Solution:
Introduce `v:startreason`
2026-06-18 15:49:12 -04:00
Gregory Anders
ed267268b8 fix(lsp): allow specifying bufnr + client_id filter when enabling capabilities #37690
Today there is a constraint that these arguments to the enable filter be
mutually exclusive, but I do not know why such a constraint exists (it
is perfectly reasonable to want to enable a capabilility for just one
buffer and just one client).
2026-06-17 07:26:18 -04:00
Steve Huff
942778c758 fix(lsp): catch another nil buffer state #40285 2026-06-16 16:20:17 -04:00
glepnir
02b7415324 fix(lsp): requery empty isIncomplete completion lists #40100
Problem:
an empty `{ isIncomplete = true, items = {} }` ends completion
instead of requerying.

Solution:
keep isIncomplete on empty lists and retrigger on keypress while incomplete.
Reset on <C-e> so it doesn't immediately re-query.
2026-06-15 18:29:27 -04:00
glepnir
724e1421f8 fix(api): keep highlight font through set/get and redraws #40200
Problem: a font set via nvim_set_hl is lost or corrupted with font-only groups,
attribute combining, and update=true, and is dropped on any attr-table rebuild.
nvim__inspect_cell also frees the font name while a returned dict still borrows it.

Solution: register font-only groups, carry font through hl_combine_attr, inherit
it on update, and persist sg_font so a rebuild can restore it. Keep interned font
names across a rebuild instead of clearing them. Add the missing font field to
get_hl_info.

Co-authored-by: Ryan Patterson <cgamesplay@cgamesplay.com>
2026-06-15 17:51:42 -04:00
Oleh Volynets
b55a868309 feat(diagnostic): debounce current-line render #39542
Problem: vim.diagnostic.Opts.VirtualLines.current_line and
         vim.diagnostic.Opts.VirtualText.current_line cause redraw
         on every CursorMoved event that makes the text jump
         uncomfortably with rapid cursor movement.

Solution: `current_line` state is applied only on CursorHold,
          while still being cleared on CursorMoved making it so that
          until the cursor has stopped on a line, its diagnostic
          looks like cursor is not on the line preventing flicker.
2026-06-15 11:11:57 -04:00
Justin M. Keyes
436761cba2 fix(tui): late-arriving OSC11 response triggers OptionSet #40270
Problem:
This test is flaky since fff9897ce3 :

    FAILED   ...Xtest_xdg_terminal/test/functional/terminal/tui_spec.lua @ 4359:
    TUI bg color does not trigger OptionSet from automatic background processing
    Expected values to be equal.
    Expected:
    { true, 0 }
    Actual:
    { true, 1 }
    stack traceback:
    ...Xtest_xdg_terminal/test/functional/terminal/tui_spec.lua:4380:
    in function <...Xtest_xdg_terminal/test/functional/terminal/tui_spec.lua:4359>

`apply_optionset_autocmd_now` does not emit `OptionSet` during startup:

    void apply_optionset_autocmd_now(...) {
      // Don't do this while starting up, failure or recursively.
      if (starting || errmsg != NULL || *get_vim_var_str(VV_OPTION_TYPE) != NUL) {
        return;
      }
      ...
    }

but if OSC 11 response arrives AFTER VimEnter, then
`nvim_set_option_value('background',…)` call triggers `OptionSet`.

Solution:
Use `:noautocmd` when setting 'background'.
Per fff9897ce3, OSC11 is not intended to trigger OptionSet.

fix https://github.com/neovim/neovim/issues/40235
2026-06-15 09:12:15 -04:00
jdrouhard
859790e244 feat(lsp): clean up semantic token initialization and debounce #40254
Problem: The refactor to use Capability left around some cruft and
semi-broken configuration for debounce.

Solution: Clean up now-unnecessary helper methods and simplify
deprecated ones to pass through to the non-deprecated ones. `debounce`
now defaults to 200 for all buffers but is overridable via the
deprecated start() method, which continues to take the max value
specified for any client attached to the buffer.

If we wish to expose changing the debounce in a non-deprecated way, we
will need to consider a "configuration" function, or even a bespoke
method to set the debounce time on the main metaclass (or provide
options to override for a particular buffer). General configuration of
specific LSP features is an as-of-yet unsolved problem.
2026-06-15 07:19:09 -04:00
zeertzjq
a69f2db773 vim-patch:9.2.0649: filetype: tf files sometimes incorrectly recognized (#40258)
Problem:  filetype: tf files sometimes incorrectly recognized
          (Christian Robinson)
Solution: Add support for g;filetype_tf variable to override detection,
          re-write the filetype detection loop

closes: vim/vim#20510

Supported by AI

522a39a489

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-06-15 05:48:35 +00:00
Igor Lacerda
8b5d80ab44 feat(events): :mksession SessionWritePre event #39688
Problem:
No event triggered just before writing a session file.

Solution:
Add `SessionWritePre`.
2026-06-14 17:04:46 -04:00
Justin M. Keyes
6f3446c970 Merge #40087 from ofseed/pos-util-follow-up
feat(pos): create a cursor position by using the current of a window
2026-06-14 12:42:52 -04:00
jdrouhard
3d6393540e feat(lsp): use LspNotify for semantic tokens #40224
Problem: The semantic token module is using its own debounce timer for
the buffer on_lines event. If its internal debounce is shorter than the
changetracking module's debounce, it's possible for semantic token
requests to fire for changed buffers before the textDocument/didChange
notification is sent to the server.

Solution: Trigger semantic token requests from the LspNotify autocmd
when the method is the didChange or didOpen notifications, which
enforces a strict happens-before relationship for the sync change
notification followed by a semantic token request.

Note: There is still an internal debounce mechanism in the semantic
token module to handle other debouncing needs specific to its
functionality, such as debouncing server refresh notifications and
handling WinScrolled events when using range requests.
2026-06-14 11:10:59 -04:00
glepnir
2e8c60cb38 vim-patch:9.2.0624: C-N/C-P cannot be mapped in complete() completion (#40232)
Problem:  Keys valid in CTRL-X mode are never mapped while insert
          completion is active, so <C-N> and <C-P> cannot be remapped
          for completion started by complete().
Solution: Do not disable mappings in CTRL_X_EVAL mode.  In this mode a
          mapping cannot interfere with selecting the completion
          method, which is what the no-mapping rule exists for.

related: vim/vim#6440
related: vim/vim#16880
closes:  vim/vim#20489

076585e6ad

Co-authored-by: Thomas M Kehrenberg <tmke8@posteo.net>
2026-06-14 05:15:07 +00:00
Justin M. Keyes
1d33a81751 test(autoread): cleanup
- Merged into the main "reloads on external change" test.
- Reduce duplication.
- Wall-clock down from ~4.4s to ~1.4s (dropped 3s debounce test).
2026-06-13 20:54:00 +02:00
Evgeni Chasnovski
e9b9426d7d fix(filetype): vim.filetype.match fails if CWD goes missing #40190
Problem: Running `vim.filetype.match()` when current working directory
  was removed from disk throws a `vim.fs.abspath` assertion error.
  However, the matching might still be possible without trying to match
  against full path (like if it is a known extension).

Solution: Safely compute absolute path and ignore it if it errors.
2026-06-13 13:20:45 -04:00
John Reid
d52ebe317d feat(diagnostic): add virt_lines_overflow option for virtual_lines #40178
Problem: Diagnostic virtual lines are hardcoded with "scroll" for
virt_lines_overflow option.

Solution: Add a `overflow` option to `virtual_lines` config
to support "wrap", "scroll", "trunc", and "auto".
2026-06-13 04:20:20 -04:00
Oleksandr Chekhovskyi
400f247397 feat(autoread): use filewatchers for OS-driven change detection #37971
Problem:
The 'autoread' option only checks for file changes reactively — on
FocusGained, :checktime, CmdlineEnter, etc. — by polling timestamps.
External changes are not detected until the user interacts with Neovim.

Solution:
Add a core module (runtime/lua/nvim/autoread.lua) enabled from
runtime/plugin/autoread.lua that watches each buffer's file using
vim._watch.watch() (libuv fs_event). On change detection it calls
:checktime, which invokes the existing buf_check_timestamp() logic
for reload/prompt handling. Watchers are managed via autocmds tied
to buffer lifecycle events and respect the 'autoread' option (global
and buffer-local).
2026-06-12 18:25:15 -04:00
Jay Madden
3ed78daf83 perf(lsp): overscan semantic_token range requests #40036
Problem:
Flickering may occur when paging up/down in big files, as ranges for semantic
tokens are requested. This happens with LSP servers like gopls which return
"/full" semantic tokens if the file is too big, where we fall back to
viewport-range token retrievals.

Solution:
Broaden the requested ranges to one viewport of "overscan" on each side plus
some padding if possible:

    (viewport_topline - viewport_height)..(viewport_botline + viewport_height)
2026-06-11 17:16:54 -04:00
Justin M. Keyes
a6584b205c docs: misc 2026-06-11 13:35:19 +02:00
Aaron Tinio
d42f7ee9dc fix(lsp): trailing blank line when edit inserts past end of buffer #40133
Problem:
A text edit positioned entirely past the last buffer line, with
newText ending in a newline, leaves a stray blank line: the
past-the-end path appends the trailing empty fragment produced by
vim.split() and does not set has_eol_text_edit, so the end-of-buffer
cleanup is skipped. Formatting servers emit such edits whenever
formatting moves text to the end of a document.

Regression from ec94014cd1 (#20137), which split the past-the-end
fast path off the clamp path that sets the flag.

Solution:
Set has_eol_text_edit in the past-the-end path, like the adjacent
path that clamps end_row.
2026-06-10 23:25:13 +00:00
Tristan Knight
16549f2f40 fix(lsp): refresh codelens despite pending debounce #40154
Problem:
When a server sends workspace/codeLens/refresh while an automatic codelens
request is already scheduled, Nvim ignores the server refresh. This can leave
rendered codelens text stale until another buffer edit triggers a new request.

Solution:
Cancel the pending automatic request and send the server-requested refresh
immediately. This preserves request coalescing while giving explicit server
refreshes priority.
2026-06-10 19:18:48 -04:00
tao
b49492f13c fix(option): set 'shell…' options based on detected shell #40031
Problem:
* 'shellcmdflag' states that its default value is set according to the
  value of 'shell', but this behavior is not yet implemented on Windows.
  The same applies to 'shellpipe', 'shellredir', and 'shellxquote'.
* On Windows, Git is often installed in paths containing spaces, and we
  still do not correctly resolve the sh executable name as described in
  'shell'.
* On Windows, the default value of 'shellslash' is always `false`,
  which causes Unix-like shells to interpret `\` in paths returned by
  some functions as escape charaters.

Solution:
Use a simple rule table to detect common shells (e.g. `cmd`,
`powershell`, shells whose names contain `csh` or `sh`) and apply
best-effort defaults, while leaving more complex scenarios to user
configuration.
2026-06-10 17:28:17 -04:00
Tristan Knight
2899e350ff docs(lsp): bump protocol/meta to 3.18 #37273
fixes glob spec regression related to "zero or more" vs "one or more" for `*`
ref: https://github.com/microsoft/language-server-protocol/issues/2217
2026-06-10 17:02:12 -04:00
zeertzjq
268cd370be vim-patch:595d0a7: runtime(doc): wrong {str} length limit in matchfuzzy() docs (#40157)
Problem:  docs say {str} is capped at 256 and longer returns an empty list.
Solution: it's 1024, and {str} plus each candidate are just truncated to
          that, not rejected; fix the text.

closes: vim/vim#20453

595d0a77e4

Co-authored-by: glepnir <glephunter@gmail.com>
2026-06-10 01:18:26 +00:00
Justin M. Keyes
8f584031bc docs: misc #40126 2026-06-08 16:12:14 -04:00
jreidx
d9aa06eed8 feat(extmark): virt_lines_overflow "wrap" and "auto"
Problem: Extmark has support for horizontal scrolling and truncating, but not wrapping.

Solution: Extend virt_lines_overflow flags to support "wrap" and "auto" based on proposed changes in #18282.
2026-06-08 22:19:25 +08:00
zeertzjq
4ab670399b vim-patch:9.2.0596: cmdline completion popup cannot be scrolled with the mouse (#40142)
Problem:  In command-line completion with a popup menu ('wildoptions'
          contains "pum"), the info popup shown next to the menu could
          not be scrolled, unlike the Insert mode completion info popup
          which scrolls with the mouse wheel.
Solution: When the mouse pointer is on top of the info popup, scroll it
          with the mouse wheel in command-line mode as well, without
          closing the completion popup menu.

closes: vim/vim#20146
closes: vim/vim#20418

96dbab257a

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 20:53:10 +08:00
Yi Ming
f79999270e feat(pos)!: match return value of to_cursor() with parameters of cursor()
Problem:
- `pos.cursor()` receives a table contains `row` and `col` as arguments,
  but `pos:to_cursor` returns `row` and `col` directly
  without wrapping them in a table.
- `pos.mark()`/`pos:to_mark` can already handle unpacked `row` `col`.

Solution:
Make `pos:to_cursor()` return a `row` and `col` in a table.
2026-06-08 19:52:51 +08:00
Yi Ming
2bd13177b8 feat(pos): create a cursor position by using the current of a window
Problem:
`vim.pos.cursor(vim.api.nvim_get_current_buf(win), vim.api.nvim_win_get_cursor(win))`
is too verbose to create a cursor position of a window,
but it is a common use case.

Solution:
Overload `vim.pos.cursor()`, so that it accepts `win` as an argument when `pos` is omitted.
2026-06-08 19:52:51 +08:00
Justin M. Keyes
ec7dab077b fix(vim.hl): range(0,…) highlight not cleared after buffer-switch #40130
Problem:
When `vim.hl.range(0, …, { timeout = N })` is called, the deferred
`range_hl_clear` captures `buf=0`, which resolves to an arbitrary
"current buffer" at timeout. This may cause a stale highlight that never
gets cleared.

Solution:
Resolve `buf=0` explicitly, before `range_hl_clear` captures it.
2026-06-06 10:26:12 +00:00
glepnir
11b9e6f193 fix(option): allow empty/blank edges in 'winborder' #40112
Problem:
The comma form of 'winborder' is split with copy_option_part(),
whose skip_to_option_part() eats spaces after a comma, and empty
fields are rejected.

Solution:
Split the comma form literally on ',', keeping empty fields and
single-space fields.
2026-06-05 06:37:07 -04:00