Commit Graph

20985 Commits

Author SHA1 Message Date
zeertzjq
2b29905c7f vim-patch:9.2.0927: curswant not set on 8g8 (#41255)
Problem:  curswant not set on 8g8
Solution: Set curswant, adjust tests (Emilien Breton)

closes: vim/vim#20979

7fe5cb35f9

Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
2026-08-10 00:39:14 +00:00
Justin M. Keyes
abc271d8f3 fix(logging): vimscript API calls #41253
Problem:
":call nvim_get_mode()" logs a nonsense channel-id:

    RPC: ch 9223372036854775808: invoke nvim_get_mode

Solution:
Check `is_internal_call`.
Also, skip this logging for RPC calls, because it's redundant with
`log_request`/`log_notify`.

    API: vim -> nvim_get_mode
2026-08-09 17:33:53 -04:00
Jan Edmund Lazo
662f983f76 vim-patch:8.2.1475: Vim9: can't use v:true for option flags (#41249)
Problem:    Vim9: can't use v:true for option flags.
Solution:   Add tv_get_bool_chk(). (closes vim/vim#6725)

----

"tv_get_bool_or_number_chk()" without vim9 params is identical to
"tv_get_number_chk()".
"tv_get_number_chk()" and tv"_get_bool_chk()" are identical
after excluding new vim9 params.
Yes, "want_bool" param is N/A because of "in_vim9script()".
If I port it, then I will refactor these macros or "static inline"
functions within "src/nvim/eval/typval.h".

----

36967b32fd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-09 06:53:31 +00:00
Jan Edmund Lazo
b3a0cfcd0a vim-patch:8.2.1597: the channel source file is too big
Problem:    The channel source file is too big.
Solution:   Move job related code to a new source file.

----

Move eval-related prompt-buffer API to src/nvim/nvim/eval/buffer.c.

https://github.com/neovim/neovim/pull/37743#issuecomment-3897416840

----

8b5866ded6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-08 14:52:26 -04:00
Jan Edmund Lazo
9c6ea122a8 vim-patch:8.2.1590: Vim9: bufnr() doesn't take "true" argument
Problem:    Vim9: bufnr() doesn't take "true" argument.
Solution:   use tv_get_bool_chk(). (closes vim/vim#6863)

fe136c9a85

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-08 09:06:53 -04:00
Justin M. Keyes
e16d577f16 Merge #41224 from justinmk/fixbuild 2026-08-08 03:59:15 -04:00
Jan Edmund Lazo
a08607b8d6 vim-patch:8.2.1478: Vim9: cannot use "true" for some popup options (#41236)
Problem:    Vim9: cannot use "true" for some popup options.
Solution:   Add dict_get_bool(). (closes vim/vim#6725)

558813314d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-08 13:19:59 +08:00
Jan Edmund Lazo
989726f3a6 vim-patch:8.2.1577: Vim9: hasmapto()/mapcheck()/maparg() do nottake "true" arg
Problem:    Vim9: hasmapto(), mapcheck() and maparg() do not take "true" as
            argument.
Solution:   Use tv_get_bool(). (closes vim/vim#6822, closes vim/vim#6824)

04d594b9c1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-08 00:28:12 -04:00
Jan Edmund Lazo
ecbae9911e vim-patch:8.2.1576: Vim9: index() does not take "true" as argument
Problem:    Vim9: index() does not take "true" as argument.
Solution:   Use tv_get_bool_chk(). (closes vim/vim#6823)

6c553f9c04

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-08 00:25:18 -04:00
Jan Edmund Lazo
b055504d41 vim-patch:8.2.1575: Vim9: globpath() doesnot take "true" as argument
Problem:    Vim9: globpath() doesnot take "true" as argument.
Solution:   Use tv_get_bool_chk(). (closes vim/vim#6821)

f966ce5ea2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-08 00:23:16 -04:00
Jan Edmund Lazo
f3491ac971 vim-patch:8.2.1574: Vim9: glob() doesnot take "true" as argument
Problem:    Vim9: glob() doesnot take "true" as argument.
Solution:   Use tv_get_bool_chk(). (closes vim/vim#6821)

5892ea1511

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-08 00:22:02 -04:00
Jan Edmund Lazo
c2f0c2b4d1 vim-patch:8.2.1573: Vim9: getreg() does not take "true" as argument
Problem:    Vim9: getreg() does not take "true" as argument.
Solution:   Use tv_get_bool_chk().  (closes vim/vim#6820)

67ff97ded7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-08 00:19:53 -04:00
Jan Edmund Lazo
e4a96c16c9 vim-patch:8.2.1572: Vim9: expand() does not take "true" as argument
Problem:    Vim9: expand() does not take "true" as argument.
Solution:   Use tv_get_bool_chk().  (closes vim/vim#6819)

551d25e765

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-08 00:16:29 -04:00
zeertzjq
390e90bba4 vim-patch:9.2.0925: crash when getcompletiontype() gets a NULL string (#41231)
Problem:  Crash when getcompletiontype()/getcompletion() gets a NULL string
          (dvaave2025).
Solution: Do not write the NUL terminator in set_cmd_context() when the
          cursor column is at or past the end of the string, since the
          string may be a read-only literal.

fixes:  vim/vim#20963
closes: vim/vim#20964

Supported by AI.

e2dcefa0d8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-08-08 09:44:54 +08:00
zeertzjq
5d5b8e3e7d vim-patch:9.2.0923: tabpage: closing a tab page loses the alternate tab page (#41229)
Problem:  Closing the current tab page resets the alternate tab page, even
          when that is another tab page which still exists, so that
          CTRL-Tab stops working (igorlfs).
Solution: Restore the last used tab page after entering another one to
          close the current one (Hirohito Higashi).

related: vim/vim#20965
closes:  vim/vim#20973

a05bd64c1d

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 09:30:03 +08:00
Justin M. Keyes
eecc4b73ff fix(coverity): UNINIT, FORWARD_NULL
CID 652778:         Uninitialized variables  (UNINIT)
    /src/nvim/context.c: 353             in ctx_dirs_save()
    347         if (curbuf->b_sfname != NULL && curbuf->b_fname == curbuf->b_sfname) {
    348           cs->cs_save_sfname = xstrdup(curbuf->b_sfname);
    349         }
    350         do_autochdir();
    351         char autocwd[MAXPATHL];
    352         if (os_dirname(autocwd, MAXPATHL) == OK) {
    >>>     CID 652778:         Uninitialized variables  (UNINIT)
    >>>     Using uninitialized value "*cwd" when calling "strcmp".
    353           cs->cs_apply_acd = strcmp(cwd, autocwd) == 0;
    354         }
    355       }
    356     }
    357
    358     /// Restores the dir state saved by ctx_dirs_save(), undoing any chdir made while switched. The

    CID 652777:         Null pointer dereferences  (FORWARD_NULL)
    /src/nvim/context.c: 556             in ctx_switch()
    550         cs->cs_target_win = wp->handle;
    551         cs->cs_target_old_pos = wp->w_cursor;
    552       }
    553       // The CWD-state snapshot is only for a real window target; hidden-buffer target is handled by the
    554       // ctx_win machinery (ctx_win_prep).
    555       if (buf == NULL || wp != NULL) {
    >>>     CID 652777:         Null pointer dereferences  (FORWARD_NULL)
    >>>     Passing null pointer "wp" to "ctx_dirs_save", which dereferences it.
    556         ctx_dirs_save(cs, wp, tp == NULL ? curtab : tp, buf);
    557       }
    558
    559       // Save the current state.
    560       cs->cs_curwin = curwin->handle;
    561       cs->cs_prevwin = prevwin == NULL ? 0 : prevwin->handle;
2026-08-08 02:23:55 +02:00
tao
f0a0182285 refactor(path): pathcmp() #41035
Problem:
Redudant code

Solution:
Add `path_fold_char()` to normalize path sep.
Refactor `pathcmp()` and `path_fnamencmp()` into `path_cmp`.

| feature                  | pathcmp        | path_fnamencmp | path_cmp(now) |
| ------------------------ | -------------- | -------------- | ------------- |
| case folding             | `mb_toupper()` | `utf_fold()`   | `utf_fold()`  |
| consults fileignorecase  |              |              | `ic` param    |
| `maxlen`                 |              |              |             |
| `/` == `\`               |              |              |             |
| MSWIN drive letter       |              |              |             |
| sep affects sorting      |              |              |             |
| ignores a trailing slash |              |              |             |

Refactor `path_fnamecmp` and `path_full_compare` into `path_equal`,
with flags controlling "no filesystem" comparison (i.e. `path_cmp`), env
variables expansion, absolute path resolution and filesystem access.
2026-08-07 19:54:29 -04:00
Justin M. Keyes
b53c00b425 fix(progress): ins-compl progress-msg during pum #41226
Problem:
The insert-mode completion progress-message is in "running" state while
the user is selecting an item. That is noisy and unwanted UX; it was
only intended for the "Scanning..." task.

Solution:
End the progress-msg just after `ins_compl_show_statusmsg`.
2026-08-07 22:49:44 +00:00
Justin M. Keyes
33a688f9fe fix(messages): dangling progress-messages #41222
Problem:
Some builtin features emit progress-messages which never "complete".
- On failure, `:write` does not complete the progress-msg it started.
- ins-completion never ends its "Scanning..." message.

Solution:
- `buf_write()` emits "failed" status on failure.
- `ins_compl_stop()` ends the completion one.
2026-08-07 16:10:02 -04:00
Jan Edmund Lazo
8773f85473 vim-patch:8.2.1533: Vim9: error when passing getreginfo() result to setreg() #41216
Problem:    Vim9: error when passing getreginfo() result to setreg().
Solution:   Use dict_get_bool() for "isunnamed". (closes vim/vim#6784)

6a950581da

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-07 16:08:54 -04:00
Jan Edmund Lazo
e0cb9004ee vim-patch:8.2.1571: Vim9: count() third argument cannot be "true"
Problem:    Vim9: count() third argument cannot be "true".
Solution:   use tv_get_bool_chk(). (closes vim/vim#6818)

119f557230

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-07 15:34:48 -04:00
Jan Edmund Lazo
feba594ed3 vim-patch:8.2.1550: Vim9: bufname('%') gives an error
Problem:    Vim9: bufname('%') gives an error.
Solution:   Only give an error for wrong argument type. (closes vim/vim#6807)

02aaad9109

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-07 14:52:34 -04:00
Justin M. Keyes
0a2676e54a fix(messages): :read starts a "bufwrite" progress #41219
Problem:
filemess() treats an empty suffix as "a buffer write is starting", but
readfile() calls it that way too. So ":read" (and ":edit", …) opens a
`nvim.bufwrite "<file>"` progress that is never completed.

Users of e.g. ghostty will see a stuck "progress" spinner.

Solution:
Only `buf_write()` starts the progress, via `filemess_progress()`.
2026-08-07 13:21:17 -04:00
Erdiansyah
59597316a6 fix(cwd): :bcd lost by nvim_win_set_buf, nvim_open_win #41218
Problem:
:bcd (buffer-local directory) is not preserved after
`nvim_open_win` or `nvim_win_set_buf`

Analysis:
set_curbuf() ends with update_cwd(), which falls back to
os_chdir(globaldir) when the target buffer has no b_localdir.

Solution:
Pass kCtxKeepCwd to ctx_switch().
2026-08-07 12:09:22 -04:00
Justin M. Keyes
7e53d3ba4d fix(cwd): keep buffer-local dir when re-editing #41215
Problem:
Re-editing a buffer (`:edit!`, re-reading a dir.lua buffer, etc.) drops
its `:bcd` directory, so the CWD falls back to the global one. Whereas
other buffer-local state (`b:` vars, local options) survives a reload.

Solution:
Don't clear buf dir in `buf_freeall()`; `do_ecmd()` calls that when
reloading/re-editing. `free_buffer_stuff()` still clears them when
a buffer is freed or reused for another file.
2026-08-07 14:10:21 +00:00
Evgeni Chasnovski
87a8bbabcf fix(highlight): explicitly define TabLineSel bg/fg #41196
Problem: `TabLineSel` by default is defined with only bold attribute.
  This makes selected tabpage stand out relatively well, but when used
  in custom tabline it will be combined with `TabLineFill` (which is
  reserved for the "non tabpage" part of the tabline).
  Plus the behavior is not consistent with the default 'tabline' which
  combines it with `Normal`.

Solution: Explicitly define background and foreground colors to come
  from `Normal` to ensure the current default 'tabline' behavior even in
  custom tabline.
  The more semantically driven solution here is to link `TabLineSel` to
  `StatusLine`. This makes it more aligned with how `TabLine` is linked
  to `StatusLineNC`. But the current "bold text with `Normal` colors" is
  argued to look better as a default.

  Also make sure that 'notermguicolors' highlighting in default and
  custom tablines is the same: the current tabpage does not have
  underline and is not bold.
2026-08-07 08:33:14 -04:00
Barrett Ruth
bc9d27b0bc fix(window): 'winbar' in single-row win overlaps global 'statusline' #41188 2026-08-07 07:06:23 -04:00
Barrett Ruth
0105f15201 fix(window): statusline can silently fail to make room #41201 2026-08-07 06:39:13 -04:00
Freddie Haddad
a8da01f8e6 fix(decor): highlight without 'hl_eol' bleeds into wrap gaps #41160
Problem:
'linebreak' filler and 'breakindent'/'showbreak' padding are screen
cells with no buffer character behind them, yet a decoration draws over
them whether or not it asked to cover such cells. A highlight bounded to
its text then paints a tail out to the edge of the row, most visible on
inline code spans from plugins. That same highlight already leaves the
cells past the end of a line alone, so it treats identical cells two
different ways.

Solution:
Only a decoration with 'hl_eol' draws the gaps, which is what the flag
already means at the end of a line. A full-width background such as a
fenced code block sets it and still covers them. Classic :syntax has no
such flag and is unchanged.
2026-08-07 05:09:48 -04:00
Justin M. Keyes
a4a544032a feat(cwd)!: :lcd! (bang), rearrange :bcd/:lcd/… scope precedence #41194
Problem:
- buf-local CWD scope is lower priority than :lcd, which is weird.
  ```
  win > buf > tab > global
  ```
- No way to clear current CWD at a given scope.

Solution:
- Rerrange scope precedence to:
  ```
  buf > win > tab > global
  ```
- Introduce "bang" variants (`:bcd!`/`:lcd!`/`:tcd!`) which clears the
  local CWD for the given scope.
2026-08-07 04:41:37 -04:00
github-actions[bot]
0e8903f44b docs: update version.c #41190
vim-patch:8.2.1091: no check if opening a pty works
vim-patch:8.2.1120: Python code not tested properly
vim-patch:9.2.0911: makefiles do not build hardcopy_postscript.c
vim-patch:9.2.0915: tests: two terminal tests in test_popupwin fail on FreeBSD

vim-patch:8.2.0290: running individual test differs from all tests
vim-patch:8.2.1132: Vim9: return type of repeat() is not specific enough
vim-patch:8.2.1133: Vim9: return type of add() is not specific enough
vim-patch:8.2.1136: Vim9: return type of argv() is always any
vim-patch:8.2.1138: Vim9: return type of copy() and deepcopy() is any
vim-patch:8.2.1140: Vim9: return type of extend() is any
vim-patch:8.2.1141: Vim9: return type of filter() is any
vim-patch:8.2.1142: Vim9: return type of insert() is any
vim-patch:8.2.1143: Vim9: return type of remove() is any
vim-patch:8.2.1144: Vim9: return type of reverse() is any
vim-patch:8.2.1158: build error
vim-patch:8.2.1176: Vim9: not enough type checking in Vim9 script
vim-patch:8.2.1191: Vim9: crash when function calls itself
vim-patch:8.2.1205: Vim9: && and || work different when not compiled
vim-patch:8.2.1290: Vim9: cannot replace a global function
vim-patch:8.2.1355: Vim9: no error using :let for options and registers
vim-patch:8.2.1373: Vim9: no error for assigning to non-existing script var
vim-patch:8.2.1376: Vim9: expression mapping causes error for using :import
vim-patch:8.2.1380: Vim9: return type of getreg() is always a string
vim-patch:8.2.1387: Vim9: cannot assign to single letter variable with type
vim-patch:8.2.1403: Vim9: Vim highlighting may fail in cmdline window
vim-patch:8.2.1437: Vim9: 'statusline' is evaluated using Vim9 script syntax
vim-patch:8.2.1447: Vim9: return type of keys() is list
vim-patch:8.2.1459: Vim9: declaring script var in script does not infer the type
vim-patch:8.2.1477: Vim9: error when using bufnr('%')
vim-patch:8.2.1502: Vim9: can use += with a :let command at script level
vim-patch:8.2.1509: vertical separator is cleared when dragging a popup window
vim-patch:8.2.1514: multibyte vertical separator is cleared when dragging popup
vim-patch:8.2.4962: files show up in git status

vim-patch:9.2.0918: screen: fill char with a zero low byte is stored as a NUL cell
vim-patch:9.2.0919: screen: the wrong array is copied into ScreenCols on a resize
2026-08-07 04:37:00 -04:00
zeertzjq
439c967010 fix(drawline): 'statuscolumn' breaks unprintable char wrapping (#41198)
Problem:
Evaluating 'statuscolumn' overwrites transchar_charbuf[], which breaks
the drawing of an unprintable char if p_extra points there.

Solution:
Make a copy in wlv.extra so that it won't be overwritten.
2026-08-07 04:01:38 +00:00
Barrett Ruth
3a39646693 fix(window): 'laststatus' change pushes win past last row #41189
Problem:
Giving a window a status line when `'laststatus'` starts requiring one
takes the row from a resizable frame found by walking up the frame
tree, but only the window's own leaf frame is grown back. Every frame
between the leaf and the donor keeps its old height, so a later resize
hands out a row that does not exist and a window's status line ends up
on the command line.

Solution:
Grow the window's frame with `frame_setheight()`, which takes the row
from a neighbouring frame and keeps every enclosing frame consistent.
2026-08-06 08:39:59 -04:00
Justin M. Keyes
eb19a52b7c feat(vim._with): keepcwd 2026-08-06 13:17:07 +02:00
Justin M. Keyes
1c1dc0558f feat(cwd): support explicit chdir (:bcd/:tcd/…) in temp context
Problem:
- Explicit `:bcd` (etc.) persists from `nvim_buf_call()` but not from an
  autocmd handler targeting a hidden buf (`LspAttach`, `TermRequest`, …),
  which needs a `vim.schedule()` workaround.
- `vim._with()` is supposed to work as a "sandbox", discarding
  side-effects, but it leaks CWD changes: `:lcd` from a `win` context,
  any chdir from a visible-buffer context.

Solution:
- Explicit :cd/:tcd/:bcd during a temp context persists by default.
  - "Ambient" directory changes ('autochdir', existing win-local CWD,
    etc.) are still undone, as before.
- Add `kCtxKeepDirs`: snapshot/restore the target's full CWD state
  (w/b/tp-local, global, cwd). Used by `vim._with()` and `'inccommand'`,
  which must not leak state.
2026-08-06 13:17:07 +02:00
Justin M. Keyes
7d2249c579 docs: misc, :bcd, slug() 2026-08-06 10:27:29 +02:00
Jan Edmund Lazo
54373e2453 vim-patch:8.2.1204: Vim9: true and false not recognized in Vim9 script (#41185)
Problem:    Vim9: true and false not recognized in Vim9 script.
Solution:   Recognize true and false.

5d2eb0fff0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-06 11:48:00 +08:00
zeertzjq
a19dcb3108 vim-patch:9.2.0914: diff: undo after :diffget into an empty buffer leaves a line behind (#41181)
Problem:  After :diffget into an empty buffer, undo does not restore the
          empty buffer, the last line stays behind (Narendran
          Gopalakrishnan)
Solution: Include the empty line of the empty buffer in the undo
          information, it is deleted once the first line was obtained
          (Hirohito Higashi).

fixes:  vim/vim#20950
closes: vim/vim#20951

c44f35ca1a

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 07:17:17 +08:00
zeertzjq
88c13ee43c vim-patch:9.2.0909: insert completion is slow to collect many matches (#41167)
Problem:  ins_compl_add() checks for a duplicate by scanning the whole
          match list, making collection of N matches quadratic.
Solution: Look matches up in a hashtab instead; each entry counts the
          matches with that string (Samuel Schlesinger).

closes: vim/vim#20926

31b7b1a7da

Co-authored-by: Samuel Schlesinger <sgschlesinger@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-08-06 06:36:22 +08:00
github-actions[bot]
f599e2b8ab docs: update version.c #41129
vim-patch:fe712ced6 Fix duplicated code that only appears in git.
vim-patch:8.2.1032: error message for declaring a variable cannot be translated
vim-patch:8.2.4344: Amiga: header file included twice
vim-patch:9.1.0979: VMS: type warning with $XDG_VIMRC_FILE
vim-patch:8f214168b runtime(doc): Update os-support section for Amiga OS
vim-patch:9.1.1894: global_runtime_dir appends /after directory when using XDG
vim-patch:9.2.0029: STRLEN() used for a string literal
vim-patch:4ed08ee60 runtime(doc): document Solaris as supported OS
vim-patch:9.2.0897: GTK3 X11 redraws are not coalesced
vim-patch:9.2.0900: FocusGained still triggered when closing dialog
vim-patch:bc71c0b3f runtime(doc): remove todo entries that are fixed
vim-patch:9.2.0903: Vim9: cannot use an exported function of an autoload import
vim-patch:9.2.0905: MS-Windows: ghost cursor with ligatures
vim-patch:78ebe0f42 CI: bump clang to v22 in ci-linux_asan

vim-patch:8.2.0972: Vim9 script variable declarations need a type
vim-patch:8.2.0973: Vim9: type is not checked when assigning to a script variable
vim-patch:8.2.1003: Vim9: return type of sort() is too generic
vim-patch:8.2.1024: Vim9: no error for using "let g:var = val"
vim-patch:8.2.1028: Vim9: no error for declaring buffer, window, etc. variable
vim-patch:8.2.3722: Amiga: superfluous messages for freeing lots of yanked text
vim-patch:8.2.3837: QNX: crash when compiled with GUI but using terminal
vim-patch:8.2.3881: QNX: crash when compiled with GUI but using terminal

vim-patch:9.1.0337: Missing entry for XDG vimrc file in :version
vim-patch:9.1.0345: Problem: gvimrc not sourced from XDG_CONFIG_HOME
vim-patch:9.1.0393: 'viewdir' not respecting $XDG_CONFIG_HOME
vim-patch:9.1.0680: VMS does not have defined uintptr_t
vim-patch:9.1.1803: Amiga: build errors
2026-08-05 15:37:48 -04:00
Tanishq
e2c0c63452 fix(statusline): don't clobber global statusline during autocmd #41169
Problem:
With `laststatus=3`, a pager float shares the main grid's statusline
row. Setting a diagnostic fires `DiagnosticChanged`, whose handler calls
`nvim__redraw({ statusline = true })`.

Analysis:
Inside the autocmd, `curwin` is temporarily switched to the tiled window
showing that buffer, so `win_redr_status()` paints its statusline over
the pager's `[Pager]` statusline on the shared row. After the autocmd,
`curwin` is restored but the pager statusline is never repainted.

Solution:
Use `ctx_saved_curwin()` decide whether to draw the global statusline,
matching `win_redr_stl_expr()` and `update_screen()`. No behavior change
if no buffer-context switch is active.
2026-08-05 13:35:09 -04:00
Chris Hebert
e58f29ca3e fix(terminal): OSC 52 multiline copy replaces newlines with NUL #41097
Problem: An OSC 52 sequence from a :terminal job passes the decoded
payload to the clipboard provider as a single list item. Command-line
providers (pbcopy, xclip, ...) receive it with channel semantics, where
a newline inside an item is sent as NUL (:h chansend()), so multiline
copies arrive with NUL bytes instead of newlines.

Solution: Split the payload on newlines into a proper list of lines.
A trailing newline yields a final empty item, which chansend() turns
back into a newline, so payloads round-trip exactly.
2026-08-05 06:37:02 -04:00
glepnir
6d8401f8d5 fix(ui): missing vertical separator for a winbar only window (#41151)
Problem: A winbar-only window with zero text height still occupies one row,
         but win_update() returns early on w_view_height == 0 and skips the
         vertical separator.

Solution: Also draw the vertical separator in the early return path.
2026-08-05 06:42:39 +08:00
Justin M. Keyes
9cd4dd1c19 fix(:bcd): do not "inherit" buffer-local dir
Problem:
Buffer-local CWD (:bcd) is "sticky", similar to window-local CWD (:lcd).
But this contradicts one of its main benefits: per-buffer "project root"
for LSP, OSC7.

Other problems:
- A buffer created with :edit/:enew/:new silently inherits b_localdir
  (and b_prevdir) from the previous buffer.
- curbuf_reusable() refuses to recycle a scratch buffer that has
  `b_localdir`.
- After :new/:vnew/:tabnew the CWD sticks to previous buffer's
  `b_localdir` even though the new curbuf has none, so :new is not
  equivalent to ":split | enew", and getcwd() disagrees with
  haslocaldir().
- Requires "which buffer spawned this buffer" semantics that no other
  buffer-local state has.

Solution:
Drop sticky/inherit behavior of buffer-local CWD (:bcd).

- do_ecmd: always apply the new curbuf's dir (`fix_current_dir`), like
  `do_autochdir` already does. :tabnew from a :bcd buffer now reverts to
  global CWD (and fires DirChanged), same as :tabnew from a :lcd window.
- curbuf_reusable(): recycling a scratch buffer frees its b_localdir.

To get sticky/inherit behavior of CWD, use `:lcd`.
2026-08-04 20:48:44 +02:00
Justin M. Keyes
46ca236525 fix(cwd): validate getcwd(…, -1) 2026-08-04 20:48:44 +02:00
Justin M. Keyes
db2e86fba4 refactor(editor): cleanup change-directory (:bcd) logic 2026-08-04 20:48:05 +02:00
saher
ea3868bcf9 feat(editor): :bcd changes buffer-local directory
Problem:
No way to set a buffer-local directory.
Use-cases:
- "Root dir" for LSP (and the "project" concept).
- `:terminal` OSC 7

Solution:
Add `:bcd` command.

- Extend `getcwd()` to take a third arg; `getcwd(-1, -1, bunfr)` returns
  the buffer-local working directory.
- Buffer-local directories have less priority than window-local
  ones, and more priority than tab-local ones.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-08-04 20:09:48 +02:00
Justin M. Keyes
838f130e6a fix(types): emmylua warning about params field 2026-08-04 20:09:48 +02:00
not_compiled
f6de99d028 fix(highlight): make Ignore hidden by default #41115
Problem:
Ignore is linked to Normal by default, making the text visible instead
of hidden.

Solution:
Replace the default link with an explicit highlight definition using
ctermfg=0 guifg=bg.
2026-08-04 13:43:22 -04:00
Justin M. Keyes
ceccca7780 fix(options): crash on ":let &l:autoread = v:true" #41158
Problem:
Assigning to the local value of a global-local boolean option
('autoread', 'autocomplete', 'fsync') aborts:

    Assertion failed: (curval.type == newval.type), function
    ex_let_option, file vars.c, line 1408.

    ex_let_one
    ex_let_vars
    ex_let
    execute_cmd0
    do_cmdline
    call_user_func
    ...
    eval_map_expr
    vgetorpeek
    vgetc
    state_enter
    main

A global-local option may have local value `kObjectTypeUnset`, but
`ex_let_option()` guards only `kObjectTypeNil`.

Solution:
When curval is Unset, resolve it to the inherited global value.
2026-08-04 13:28:26 -04:00