100 Commits
Author SHA1 Message Date
Hirohito Higashi 90d3806e39 patch 9.2.1252: Vim9: autoload script sourced for an exported value fails
Problem:  When the value of an exported variable sources an autoload
          script, the script fails to load with E1043.
Solution: Reset is_export while sourcing a script, and remove the reset
          added in patch 9.1.1040 (Hirohito Higashi)

closes: #21610

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-10-27 16:13:04 +00:00
Hirohito Higashi 16b6f55eb6 patch 9.2.1189: CTRL-W command fails when CursorHold triggers
Problem:  When CursorHold triggers while waiting for the key after
          CTRL-W, the CTRL-W command fails with a beep(Emilien Breton).
Solution: Do not trigger CursorHold while getting the keys of a CTRL-W
          command (Hirohito Higashi).

fixes:  #21481
closes: #21485

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-10-14 18:50:26 +00:00
Hirohito Higashi c10f972446 patch 9.2.1188: prop_type_get() does not return the "override" item
Problem:  prop_type_get() does not return the "override" item, although
          it is documented to return the fields given to prop_type_add().
Solution: Add the "override" item (Hirohito Higashi).

closes: #21497

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-10-14 18:43:08 +00:00
Hirohito Higashi 21e109b324 patch 9.2.1187: tuple type with many items reads past the end of an array
Problem:  A tuple type with more than 127 items gets a wrong item count
          and reads past the end of an array.  Allocation failure for a
          tuple type is not handled.
Solution: Use an int for the item count.  Use the "any" type when
          allocation fails (Hirohito Higashi).

closes: #21517

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-10-14 18:37:36 +00:00
Hirohito Higashi 99b9dd00cd runtime(doc): Fix documentation for getinfo()
Problem:  The documentation for getinfo() is hard to understand.
Solution: fix it.

closes: #21475

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-10-11 17:31:08 +00:00
Hirohito Higashi b2b47bdf94 patch 9.2.1172: Vim9: crash when lambda assigns to item of outer argument
Problem:  Assigning to an element of an outer function's argument inside
          a lambda causes a crash when the lambda is called.
Solution: When an outer function's argument is found on the left-hand
          side of an assignment, record that the outer scope is used and
          treat the lambda as a closure.

When an outer function's argument was used on the left-hand side of an
assignment, a LOADOUTER instruction was generated, but the lambda was
not treated as a closure. Consequently, the outer stack was not set for
the partial, leading to a NULL reference during the execution of
LOADOUTER.

fixes:  #21460
closes: #21465

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-10-07 19:06:37 +00:00
Hirohito Higashi ec130c0fd9 patch 9.2.1171: Vim9: lambda split over lines gives an internal error
Problem:  In a {} block of :autocmd or :command, a lambda whose
          expression continues on the next lines gives E341 and loops
          forever, or E342 when "|" and a command follow it.
Solution: Stop splitting the lambda into lines at the end of the
          expression.

fixes:  #21453
closes: #21455

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-10-07 18:11:05 +00:00
Hirohito Higashi 5979d7dd73 PR template duplicates the commit message and needs edits to fill in
Problem:  The PR template asks again for what the commit message
          already provides as the title and description, and its
          checklist items list alternatives in one line that must be
          edited instead of ticked.  AGENTS.md shows a patch number in
          the subject, which is added only when merging.
Solution: Explain the commit message form in a comment, give each
          alternative its own checkbox, and drop the patch number from
          the AGENTS.md example.

closes: #21454

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-10-06 18:24:45 +00:00
Hirohito Higashi 89c0f36163 patch 9.2.1160: no way to get the definition of item from Vim script
Problem:  There is no way to get the definition of a builtin or a user
          defined function, of an Ex command, of an option or of a v:
          variable from Vim script.  A language server has to parse the
          help text or the output of ":function" and ":command" for it.
Solution: Add getinfo({kind}, {name} [, {opts}]), which returns a Dict
          with the definition of {name}: a function, an Ex command, an
          option or a v: variable.  Keep the names of the arguments of
          the builtin functions in their table and report them in
          "args" (Hirohito Higashi).

closes: #21293

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-30 20:57:50 +00:00
Hirohito Higashi ae8837c19d patch 9.2.1159: :append in a block that is not executed reads its text as commands
Problem:  In a block that is not executed, the text lines of :append,
          :insert and :change are parsed as commands, so e.g. a text
          line "endif" ends the block
Solution: Read and discard the text up to "." while skipping.  Add the
          commands to the ":help :bar" list.

closes: #21331

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-30 20:31:07 +00:00
Hirohito Higashi 7aa9820618 patch 9.2.1158: sourcing a buffer drops the line after 248 bytes
Problem:  Sourcing lines from a buffer drops the line after one that is
          248 bytes long: it is taken for the rest of that line.
Solution: Only read more of a line when reading from a file; a line of
          a buffer is taken as a whole (Hirohito Higashi).

closes: #21392

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-30 20:16:15 +00:00
Hirohito Higashi 950f613ae1 patch 9.2.1157: Vim9: a lambda called after a constant operand is not callable
Problem:  In a :def function a lambda in parentheses that is called
          right after a constant operand gives E1085, while it works at
          the script level: the constant is pushed on the stack after
          the lambda.
Solution: Generate the pending constants before the lambda.

closes: #21403

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-30 19:48:15 +00:00
Hirohito Higashi d2c914cb1b patch 9.2.1153: deepcopy() drops null items
Problem:  deepcopy() of a list or dict that holds a null list, tuple or
          dict drops items, and getscriptinfo() with "sid" leaves out
          "variables" and "functions" for a script with such a variable.
Solution: In item_copy(), do not treat a null list, tuple or dict as a
          copy failure (Hirohito Higashi).

Test_deepcopy_null_item() checks that deepcopy() of a dict and of a list
holding a null dict, list and tuple gives an equal copy, in legacy Vim
script and Vim9 script.  Test_getscriptinfo_null_var() checks
"variables" and "functions" of getscriptinfo() for a Vim9 script with a
null_dict script variable next to another one.

closes: #21409

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-29 19:14:51 +00:00
Hirohito Higashi 5dbb5be94c patch 9.2.1144: Vim9: indexing a member of a dict<any> is slow
Problem:  Getting an item from a list or dict that is the member of a
          dict<any>, such as "d.big[key]", is slow when it is big.
Solution: In check_typval_type() do not go through the values when
          list<any> or dict<any> is expected (Hirohito Higashi).

The check is done by ISN_CHECKTYPE for every such index.  With a
dict<any> of 2581 lists, indexing each one took 28 seconds before and
0.002 seconds after.

closes: #21389

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-29 17:55:39 +00:00
Hirohito Higashi e04cd695e1 PR template has typos and disagrees with CONTRIBUTING.md
Problem:  The PR template has typos, calls the "related:" header
          "references:", and does not agree with CONTRIBUTING.md on
          Signed-off-by or with AGENTS.md on the Solution line.
Solution: Fix the typos and make the template agree with them.

closes: #21397

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-29 17:46:39 +00:00
Hirohito Higashi 79455c5733 CI: PRs disclosing AI assistance are not labeled
Problem:  A PR whose commits have an "Assisted-by:" trailer gets no
          label, and contributors cannot add one themselves.
Solution: In the Labeler workflow, add the "AI assisted" label when a
          commit message of the PR has an "Assisted-by:" trailer.

closes: #21399

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-28 21:37:36 +00:00
Hirohito Higashi 18ec0a76f0 patch 9.2.1143: text property continuation wrong after undo/redo
Problem:  After undo or redo a text property may still be marked as
          continuing to or from a line that is no longer next to it,
          when the property was added after the change was saved
          (david-k).
Solution: After undo and redo clear the continuation flags that have
          no partner in the line above or below the restored lines,
          and remember in the undo entry those cleared on the lines
          around them, to put them back when the entry is applied the
          other way.

Undo and redo restore the saved lines as they were, but a line just
outside of them may have got or lost a property since.  The flags
cleared on that line are kept with the undo entry, not in the undo
file, so that undoing the redo joins the property again instead of
splitting it.  The line itself is not touched, so marks and signs on
it stay where they are.

Add Test_prop_undo_redo_added_across_lines(), which checks
prop_list() after redo deletes the line where a property starts or
where it ends, and after undo brings the line back as one property
again.

fixes:  #21350
closes: #21366

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-28 20:25:17 +00:00
Hirohito Higashi 265dbb84d7 patch 9.2.1142: Vim9: line in :def starting with a quote mistaken for heredoc
Problem:  In a :def function a line that starts with a single-quoted
          string reading like "name =<< END" is taken as the start of
          a heredoc, giving E1145 and swallowing the rest of the file.
Solution: Only skip a range when a colon precedes it, since in Vim9
          script a leading "'" without one starts a string, not a
          mark (Hirohito Higashi).

closes: #21377

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-28 19:53:58 +00:00
Hirohito Higashi 6175ce8762 patch 9.2.1140: Vim9: :def in legacy script can create a script variable
Problem:  A :def function in a legacy script can create a script-local
          variable by assigning to it, while declaring one with "var"
          gives E1101.
Solution: Give E1089 for assigning to an unknown script-local variable
          in any :def function, not only in one defined in a Vim9
          script.  Remove uf_script_ctx_version, which was only used
          for this check.  Do not give it with ":source ++dryrun".

runtime/menu.vim created s:bmenu_short, s:bmenu_count, s:suglist,
s:fromword, s:changeitem, s:additem and s:ignoreitem this way, define
them at the script level.

":source ++dryrun" does not execute ":let" in a legacy script, thus
every script variable would be unknown when compiling.  Document that
reading or calling such a variable without "s:" still gives an error,
and separate the paragraphs of ":source-dryrun" with blank lines.

Test_unlet() created s:somevar this way, define it at the script level
instead.  Test_using_s_var_in_function() checks that assigning to
s:scriptlevel in a :def function of a legacy script gives E1089 when
the variable does not exist.  Test_source_dryrun() checks that
assigning to a script variable with "s:" in a :def function of a
legacy script gives no error with ":source ++dryrun".

closes: #21379

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-28 19:22:15 +00:00
Hirohito Higashi d1fa936224 runtime(javascript): missing :endif in javascriptcomplete#CompleteJS()
Problem:  The "if a:findstart" block in javascriptcomplete#CompleteJS()
          has no matching :endif.
Solution: Add the missing :endif before :endfunction.

This has no user-visible effect.  Both branches of the block return
before reaching :endfunction, so calling the function never gives
E171 and completion works as before.

closes: #21388

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-28 18:02:20 +00:00
Hirohito Higashi 0104c2052a patch 9.2.1136: Vim9: cannot change an item of a read-only v: variable in :def
Problem:  Assigning to an item of a read-only v: variable, gives E46 in
          a :def function, while it works at the script level and
          ":help clipboard-providers-define" does it.
Solution: Check that a v: variable is read-only only when no index
          follows, as for a script variable.  Make v:clipproviders an
          empty dict at startup, as v:colornames, so that a :def function
          can add the first item.

closes: #21391

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-28 17:52:19 +00:00
Hirohito Higashi f3dc0fee77 patch 9.2.1132: skip condition not considered for certain commands
Problem:  "if 0" condition not correctly skipped for :command, :autocmd,
          :class, :interface, :enum and :loadkeymap
Solution: Skip those commands and discard the blocks they read
          (Hirohito Higashi).

closes: #21349

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-25 21:49:38 +00:00
Hirohito Higashi 5959274607 runtime(doc): Tweak documentation style
closes: #21361

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-25 21:00:39 +00:00
Hirohito Higashi 12ff5ce7fd patch 9.2.1130: Vim9: assigning a Number to $VAR or @r is not an error
Problem:  Vim9: assigning a non-String value to an environment
          variable, a register or a String v: variable at the script
          level converts the value, while a :def function gives E1012.
Solution: Also check the type at the script level and give E1012

Using "@#" still takes a Number with "=".

Add Test_assign_string_only(), which checks that these fail with E1012
both in a :def function and at the script level: "= 123", "..= 123"
and "= true" on $XSTRING_ONLY, @a and v:errmsg, "@# ..= 1" and
"[$XSTRING_ONLY, @a] = [1, 2]".  It also checks that legacy :let still
converts a Number to a String for these three targets.

closes: #21364

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-25 20:49:31 +00:00
Hirohito Higashi e9b86faf1d runtime(termdebug,json): unused variables are left in :def functions
Problem:  GetRemotePtyDev() and BufUnloaded() in termdebug declare loop
          variables they never use, the variable window code declares
          "spaceBuffer" and never uses it, and FormatRange() in
          dist/json.vim computes "indent" and never uses it.
Solution: Remove the unused declarations, loop with "_" where only the
          count matters, and iterate over values() where the keys are
          not needed (Hirohito Higashi).

closes: #21368

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-24 20:36:27 +00:00
Hirohito Higashi 3231226ae9 patch 9.2.1122: ":silent make" leaves the window blank until CTRL-L
Problem:  After ":silent make" or ":silent grep" the window stays blank
          until the screen is redrawn by hand.
Solution: Ask wait_return() for the redraw where the output of the
          command cannot be seen anyway: with the screen swapped or in
          the GUI.  With an empty 't_ti' the output is left on the
          screen, as it was.  Test_silent_shell_output_kept() in
          test_shell.vim checks that ":silent !seq 1 3" leaves its
          output there (Hirohito Higashi).

closes: #21329

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-19 15:47:48 +00:00
Hirohito Higashi da50a9613c patch 9.2.1120: tests: Test_lsp_incomplete_message_while_blocked is flaky on macOS
Problem:  Test_lsp_incomplete_message_while_blocked waits a fixed 20
          msec before sending the second half of a notification, which
          a loaded machine stretches past the 100 msec an incomplete
          message is kept.
Solution: Send the second half once the other Vim reports that its
          blocking reads have started.  Ask for the count a few times
          with a pause in between and put the numbers in the message.

closes: #21345

Assisted-by: Claude
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-17 21:32:50 +00:00
Hirohito HigashiandClaude Opus 5 4b3e2e3db0 patch 9.2.1119: 'fillchars' "vert" does not fall back to the default
Problem:  When 'fillchars' is set without a "vert" item, the vertical
          separator is drawn with a space instead of the documented
          default '|' (habamax).
Solution: Use '|' as the internal default for "vert" in
          set_chars_option() (Hirohito Higashi).

fixes:  #21322
closes: #21325

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-17 20:13:36 +00:00
Hirohito HigashiandClaude Fable 5.1 722c901219 patch 9.2.1111: Crash in a zero-width window with a status line
Problem:  borrow_stl_vsep_hl() takes the status line highlight from the
          cell before the vertical separator, which a window of zero
          width does not have: the cell before the screen is read.  With
          the windows laid out for a size the GUI has not reached, the
          rows below the screen are read as well, which crashes gvim on
          MS-Windows in test_popup.vim since the tests redraw the shell
          after setting its size (after v9.2.0488).
Solution: Skip a window of zero width and stay inside the screen.
          Test_statusline_vsep_borrow_zero_width_window() puts a zero by
          zero window next to another one with both status lines on the
          first screen line, which reads before the screen without the fix.
          (Hirohito Higashi).

fixes:   vim/vim-win32-installer#487
related: #20182
closes:  #21313

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-15 17:35:56 +00:00
Hirohito HigashiandClaude Fable 5.1 24e2cf431e patch 9.2.1109: Popup image is drawn over a popup with a higher zindex
Problem:  The image of a popup window is drawn on top of every other
          popup, also one with a higher zindex that covers it: the kitty
          placement, the GTK4 image list and the GDI and Cairo blits all
          go on top of the text.  Only the sixel backend redraws the
          covered cells.
Solution: Draw the image in the rectangles that no popup with a higher
          zindex covers, from the popup mask: one kitty placement, one
          GUI blit or one GTK4 image entry for each (Hirohito Higashi).

closes: #21298

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-15 17:06:54 +00:00
Hirohito HigashiandClaude Fable 5.1 9e80ca3cbd patch 9.2.1105: tests: Test_lsp_incomplete_message_while_blocked fails on macOS
Problem:  Test_lsp_incomplete_message_while_blocked failed three times
          in a row on macOS, twice in one day, with the notification
          counted as zero.  The second half of the notification is sent
          50 msec after the first, half of the 100 msec an incomplete
          message is kept.
Solution: Send the second half after 20 msec.

closes: #21299

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-14 18:27:53 +00:00
Hirohito HigashiandClaude Fable 5.1 7594b2e3ed patch 9.2.1104: Vim9: some builtin functions have an imprecise return type
Problem:  The Vim9 return type of autocmd_add() and autocmd_delete() is
          a Number while they return a Bool, reltime() gives list<any>
          for a List of Numbers, searchcount() dict<any> for a Dict of
          Numbers and matchfuzzypos() list<any> for a List of Lists.
          The return type of get(), abs(), sign_define(), match(),
          expand(), glob(), globpath(), findfile(), diff() and
          serverlist() is "any" for every call, while the type follows
          from the argument types or from the number of arguments: get()
          on a Blob returns a Number, abs() of a Float a Float, expand()
          without {list} a String.  submatch() is typed as a String even
          with {list}.  The help has the types right.
Solution: Give the table the types the functions return, with a return
          type function where the type depends on the arguments: a
          String for the functions that return a List only with an
          optional argument, when that argument is absent; the type of
          the item for get() when a missing item has the same type;
          Float or Number for abs(); Number or list<number> for
          sign_define(); Number for match().  A Vim9 script that assigns
          one of these to a variable of another type gets E1012 with
          this change; that includes the Number of get() assigned to a
          Bool, as it already is for len() (Hirohito Higashi).

closes: #21292

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-14 18:22:42 +00:00
Hirohito HigashiandClaude Fable 5.1 c038f80703 patch 9.2.1102: listener_add() reports a joined line as it was before the join
Problem:  After joining lines with "J", a listener added with
          listener_add() and the "text" option receives the first line
          as it was before the join: um_store_changes() replaces the
          line in the memline without updating ml_line_textlen, so
          add_change_text() copies only the old length.  An LSP client
          relaying the text loses the joined part.
Solution: Update ml_line_textlen in um_store_changes()
          (Hirohito Higashi).

closes: #21302

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-14 18:11:59 +00:00
Hirohito HigashiandClaude Fable 5.1 356ba75935 runtime(doc): the clipboard provider samples call system() without :silent
Problem:  The wl_clipboard sample in wayland.txt and the WSL sample in
          eval.txt call system() and systemlist() without :silent, so
          the terminal is put in cooked mode while the command runs and
          what it sends in the meantime, such as a focus event, shows up
          on the screen.
Solution: Prepend :silent in both samples, the WSL one as :def functions
          since a lambda cannot carry a modifier, and tell in the
          section on the callbacks that a command run with system() or
          systemlist() needs it.

fixes:  #21217
closes: #21308

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-14 17:41:58 +00:00
Hirohito HigashiandClaude Fable 5.1 e502a81450 runtime(doc): wrong return type of libcallnr(), pow() and pum_getpos()
Problem:  The help gives the return type of libcallnr() as a String and
          that of pow() as a Number, while the first returns a Number and
          the second a Float, as the text of both entries says.  The Dict
          pum_getpos() returns holds only Numbers, the help says dict<any>.
Solution: Correct the three "Return type:" lines.

closes: #21291

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-13 15:16:54 +00:00
Hirohito HigashiandClaude Fable 5.1 108c68d526 patch 9.2.1094: Vim9: a name with an underscore is taken as argument
Problem:  In Vim9 script "ch_log" on a line of its own gives E1144
          "Command ch is not followed by white space", as if it were
          ":change" with "_log" behind it, while "strlen" gives E476
          "Invalid command". The message sends the reader looking for a
          missing space.
Solution: When the character after the command name is an underscore,
          treat the word as an invalid command.  Nothing is executed
          either way; the "exit_cb" line that once ran ":exit" now gets
          E476 (Hirohito Higashi).

closes: #21296

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-13 14:57:57 +00:00
Hirohito Higashi 95c46d77c7 patch 9.2.1093: unnecessary PROTO checks
Problem:  unnecessary PROTO checks
Solution: Remove the the redundant "defined(PROTO)"
          (Hirohito Higashi).

closes: #21295

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-13 14:44:38 +00:00
Hirohito HigashiandClaude Fable 5.1 ee581a53db patch 9.2.1092: tests: Test_sign_jump_name_with_bar fails on MS-Windows
Problem:  Test_sign_jump_name_with_bar fails on MS-Windows with E303,
          the buffer name contains a bar which is not valid in a file name
          there and the swap file cannot be created.
Solution: Do not create a swap file for the buffer, the name itself is
          what the test is about. Drop the CheckFeature signs test, it
          is set at the top of the test file

closes: #21294

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-13 14:32:32 +00:00
Hirohito HigashiandClaude Fable 5.1 e376846379 patch 9.2.1084: Cannot check a script without executing it
Problem:  There is no way to have Vim read a script and compile its
          :def functions without running it, so that a script can be
          checked for errors without its side effects.
Solution: Add "++dryrun" to ":source": only the definitions in the
          script are executed, a declared variable gets its type but
          not its value, everything else is skipped, then the functions
          are compiled and the errors reported.  An error in a
          definition does not stop the reading.  The condition of an
          ":if", ":elseif", ":while" or ":for" and an import name with
          a function call are not evaluated, and no SourceCmd,
          SourcePre or SourcePost autocommand is triggered
          (Hirohito Higashi).

closes: #21257

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-12 16:30:23 +00:00
Hirohito HigashiandClaude Fable 5.1 5664658f64 patch 9.2.1079: GTK4: popup image stays on the screen when the text scrolls
Problem:  With the GTK4 GUI, the image of a popup window stays on the
          screen when the text under it scrolls or is cleared, for
          example by ":version".  The other image backends paint the
          image once, and the text written over it removes it.
Solution: Remove an image from the list of images to render when a cell
          it covers is cleared or moved.  The next redraw emits it again
          (Hirohito Higashi).

related: #21234
closes:  #21274

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-11 21:46:16 +00:00
Hirohito HigashiandClaude Fable 5.1 fee1b700ba patch 9.2.1078: MS-Windows: warning for a size_t to int conversion in insexpand.c
Problem:  get_user_highlight_id() passes the size_t of STRLEN() to
          syn_check_group(), which takes an int.  MSVC warns with C4267.
          (after v9.2.1001).
Solution: Cast to int, like the other callers do (Hirohito Higashi).

related: #21105
closes:  #21279

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-11 21:41:59 +00:00
Hirohito HigashiandClaude Fable 5.1 f15ebc01af patch 9.2.1077: GUI: gui_mch_wait_for_chars() takes an int on some systems
Problem:  gui_wait_for_chars() passes a long to gui_mch_wait_for_chars(),
          the GTK and X11 implementations take a long, the MS-Windows,
          Photon and Haiku ones take an int.
Solution: Take a long everywhere (Hirohito Higashi).

closes: #21278

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-11 21:37:02 +00:00
Hirohito HigashiandClaude Fable 5.1 a162f24a1b patch 9.2.1076: Regenerate prototypes using "//" comments
Problem:  The first and the last line of the generated .pro files are
          "/* */" comments.
Solution: Regenerate the files with "make proto", update the hand
          written protoype files to match the style, update the
          generator to use // comments instead, add socketserver to
          PROTO_FILES (Hirohito Higashi)

closes: #21277

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-11 21:35:13 +00:00
Hirohito HigashiandClaude Fable 5.1 3362c8c89f patch 9.2.1074: popup: image stays on the screen in another tab page
Problem:  The image of a tab-local popup window stays on the screen
          after switching to another tab page, while the border and the
          background of the popup are gone.  The image backends keep an
          image until it is removed: a kitty placement and a GTK4
          texture until they are deleted, GDI and cairo pixels until the
          area is repainted, sixel pixels until the screen is cleared.
Solution: Remove the images of the popups local to a tab page when the
          tab page is left, they are emitted again when it is entered.
          (Hirohito Higashi).

related: #21234
closes:  #21273

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-11 21:15:43 +00:00
Hirohito HigashiandClaude Fable 5.1 737b761ee6 patch 9.2.1073: MS-Windows: testing.obj and sound.obj are not rebuilt on header changes
Problem:  With Make_mvc.mak, testing.obj and sound.obj are only rebuilt
          when their own source file changes.  The rule for testing.obj
          names term.obj as its target, sound.obj has no rule at all, so
          both are built by the inference rule, which does not depend on
          the header files.  Linking fails with an unresolved
          in_vim9script() after patch 9.2.1044 unless the old object is
          deleted by hand.
Solution: Name testing.obj in its rule and add a rule for sound.obj
          (Hirohito Higashi).

closes: #21272

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-11 21:03:48 +00:00
Hirohito HigashiandClaude Fable 5.1 35bf24c52e patch 9.2.1070: Other channels are not read while waiting for a response on one
Problem:  While ch_evalexpr() waits for a response, nothing is read
          from the other channels: what they receive stays in the pipe,
          and a message of theirs that was only partly read is dropped
          as garbage after 100 msec, along with what follows it.
Solution: Wait for the response and for the other channels together,
          reading what arrives on any of them; count the timeout over
          the whole wait.

closes: #21262

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-11 20:23:44 +00:00
Hirohito HigashiandClaude Fable 5.1 cff83f361d patch 9.2.1067: Completion shows an included file by full path
Problem:  A match found in an included file is shown with the full path
          of the file, while a match from a buffer is shown with the
          name under the current directory.  A file included as
          "./file" even has the "./" left in: "dir/./file".
Solution: Show the file by its name under the current directory, and
          simplify the name of a file found relative to the current
          one (Hirohito Higashi).

closes: #21264

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-10 19:22:37 +00:00
Hirohito HigashiandClaude Fable 5.1 3749cfb814 patch 9.2.1066: tests: GUI shell resize can land in the middle of a test
Problem:  In a GUI build the shell may be resized only after a redraw,
          so a test that measures windows can see the resize land
          halfway, Test_window_width for one.
Solution: Redraw after setting the size for a test, so that the resize
          is done before the test starts (Hirohito Higashi).

closes: #21263

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-10 19:11:43 +00:00
Hirohito HigashiandClaude Fable 5.1 71a0e7ca13 runtime(netrw): netrw#fs#Glob() cannot list a remote directory
Problem:  netrw#fs#Glob() calls s:NetrwRemoteListing() and uses
          s:THINLIST, which are script-local to autoload/netrw.vim and
          not visible in autoload/netrw/fs.vim.  Listing a remote
          directory in the tree view fails with E117 and E121.
Solution: Use netrw#Call() and netrw#Expose(), which exist to reach
          the script-local functions and variables of netrw.vim.

closes: #21259

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-09 22:08:32 +00:00
Hirohito HigashiandClaude Fable 5.1 b6e742aec5 patch 9.2.1056: terminalprops() does not report a direct color terminal
Problem:  A terminal entry with 16777216 colors, such as xterm-direct,
          needs 'termguicolors' to show its colors, and a vimrc has no
          way to tell that it is such a terminal.
Solution: Add "rgb" to terminalprops(), 'y' when 't_Co' is 16777216,
          and document setting 'termguicolors' from it
          (Hirohito Higashi).

related: #21251
closes:  #21251

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-09 18:56:06 +00:00
Hirohito HigashiandClaude Fable 5.1 1cb30afd95 patch 9.2.1055: Vim9: a lambda with a block body fails to compile after error
Problem:  When ":defcompile" compiles several functions and one of them
          fails, a function after it that contains a lambda with a
          block body fails as well, with E1028 and nothing else.
Solution: In get_function_body() only consider errors that were given
          while reading the body.  Keep define_function() from defining
          a function whose header had an error (Hirohito Higashi).

closes: #21252

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-09 18:49:08 +00:00
Hirohito HigashiandClaude Opus 5 e53a8161d3 patch 9.2.1053: libvterm: characters can get a different width in a terminal window
Problem:  Some characters get a different width in a terminal window
          than in an ordinary window.
Solution: When the application provides a width function, use it as the
          only source for the width of a character (Hirohito Higashi).

libvterm looks up its own "fullwidth" table before calling the wcwidth()
function that Vim provides.  That table holds Unicode 12 data, while Vim
follows a newer version, so U+1F93B and U+1F946 are two cells wide in a
terminal window and one cell wide everywhere else.  U+302A-302D and
U+3099-309A are affected as well: both tables list them as wide, but the
function Vim provides reports zero for a composing character.

Skipping the table when a wcwidth() function is provided makes that
function the only authority, so a terminal cell gets the same width as
the character gets in a buffer.  A build of libvterm without such a
function keeps using the table.

closes: #21213

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-08 20:41:09 +00:00
Hirohito HigashiandClaude Fable 5.1 673be365fd patch 9.2.1049: Cannot use the stdin and stdout of Vim as a channel
Problem:  A Vim started by another program cannot talk to it over its
          stdin and stdout the way a language server does; a script has
          to make it connect to a socket instead.
Solution: Add the --stdio-channel argument and the "stdio" address for
          ch_open().  Vim then serves the channel instead of reading Ex
          commands and exits when it is closed.  Stdin and stdout are
          redirected to the null device so that other output cannot get
          into the channel (Hirohito Higashi).

closes: #21245

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-08 19:06:37 +00:00
Hirohito HigashiandClaude Fable 5.1 7808a184d9 patch 9.2.1039: MS-Windows: Unix domain socket channels fail
Problem:  On MS-Windows, ch_listen() and ch_open() with a "unix:"
          address fail with E1573 unless a TCP channel was used before
          in the same Vim process.
Solution: Initialize Winsock before creating a Unix domain socket, as
          is done for TCP sockets (Hirohito Higashi).

closes: #21242

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-07 20:01:09 +00:00
Hirohito HigashiandClaude Opus 5 ce72ffb328 patch 9.2.1037: crash when slicing a range() list with too many items
Problem:  Vim crashes when slicing a list from range() that has more
          than 2147483647 items.  range() also reports a start past
          the end for a valid range that spans the whole Number
          range, and len() changes after a list with a large {stride}
          is materialized (liuyi1231).
Solution: Give E1510 when the number of items or {stride} does not fit
          in an int, and compute the length with unsigned arithmetic so
          it cannot overflow.  Also stop list_slice() from using a NULL
          item, which 9.0.2123 made possible by re-checking the index
          after materializing (Hirohito Higashi).

fixes:  #21235
closes: #21236

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-06 18:36:06 +00:00
Hirohito HigashiandClaude Opus 5 fa1ddffcce patch 9.2.1031: 'wildmode' list:full does not show 'wildmenu'
Problem:  With 'wildmode' set to list:full the matches are listed but the
          wildmenu is not shown, although it is "full" that starts
          wildmenu mode (zeertzjq).
Solution: List the matches and show the menu, as the two behaviors in
          the same phase ask for.  The menu is left to the phases that
          ask for it, so that "list" on its own still only lists
          (Hirohito Higashi).

fixes:  #21196
closes: #21205

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-01 21:22:50 +00:00
Hirohito HigashiandClaude Opus 5 260712df33 patch 9.2.1028: redraw: cursor is left in the wrong place with an operator pending
Problem:  With an operator pending, a :redraw from an autocommand or a
          callback leaves the cursor where the drawing ended, so it is
          seen in the wrong place until the operator is finished.  A
          popup closed from such an autocommand shows this.
Solution: Put the cursor back after the screen is updated.  This has to
          happen before RedrawingDisabled is restored, which an
          autocommand may have set, since setcursor() does nothing then.

closes: #21199

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-01 19:19:10 +00:00
Hirohito HigashiandMaxim Kim 5c9c5a43c1 runtime(c): syntax depends on the 'iskeyword' option
Problem:  C keywords are matched using the characters from 'iskeyword',
          so changing that option highlights part of an identifier as a
          keyword and leaves keywords containing an underscore
          unhighlighted.
Solution: Set the keyword characters with ":syn iskeyword".

fixes:  #21173
closes: #21176

Co-Authored-By: Maxim Kim <habamax@gmail.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-30 21:25:07 +00:00
Hirohito HigashiandClaude Opus 5 abb89168d6 patch 9.2.1022: popup: width changes while scrolling
Problem:  The width of a popup window changes while it is scrolled when
          it has a scrollbar and a line that wraps.  The border is left
          broken where the popup got narrower.
Solution: Reserve the scrollbar column only once, and do not adjust the
          width for a scrollbar that was already there
          (Hirohito Higashi).

closes: #21183

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-30 20:16:52 +00:00
Hirohito HigashiandClaude Opus 5 3e06209e5e runtime(doc): usr_05: packadd in a vimrc needs the "!"
Problem:  Four of the package sections tell the reader to load the
          plugin with "packadd", and the comment one goes on to talk
          about putting that line in the vimrc file.  Without the "!"
          the package is loaded there and then rather than during the
          usual startup, which is not what a vimrc wants.  The matchit
          section then explains the help file being found by saying
          ":packadd" loaded the plugin, which is what the "!" keeps it
          from doing.
Solution: Give every package section the same line to write, correct the
          reason the help file is found, and say once, where the
          packages are introduced, which of the two forms belongs in a
          vimrc.

closes: #21186

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-30 19:50:13 +00:00
Hirohito Higashi b6bdc0f532 runtime(doc): terminal: the ruler in Terminal-Job mode
Problem:  Nothing says why the cursor position shown by the 'ruler' does
          not follow the cursor in a terminal window while the job runs.
Solution: Say that what the terminal shows reaches the buffer only when
          Vim takes over, so there is no position to report until then.

fixes:  #21174
closes: #21190

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-30 19:33:55 +00:00
Hirohito HigashiandClaude Opus 5 de5b4ee453 patch 9.2.1020: autocmd: crash when 'eventignore' is changed while it is being set
Problem:  Vim crashes when an autocommand that is triggered by setting
          'eventignore' or 'eventignorewin' changes that option again.
          This happens with plugins that use ":noautocmd" in an
          autocommand for an event that is checked in the main loop
          (Brian E Clow).
Solution: Trigger the events with a copy of the old value in effect, so
          that the value the caller is still using is not freed.  Keep
          the window that holds 'eventignorewin' from being closed while
          the events are triggered (Hirohito Higashi).

fixes:   #21169
related: #21074
closes:  #21175

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-28 17:10:52 +00:00
Hirohito HigashiandClaude Opus 5 c8e432b266 patch 9.2.1019: completion asked for during 'autocompletedelay' looks automatic
Problem:  A completion asked for with CTRL-X CTRL-O while
          'autocompletedelay' is running is given the look of an
          automatic one, the implicit "noselect" among it.
Solution: Turn autocompletion off where a typed key takes the completion
          over.  A completion already on screen goes on being what it
          was (Hirohito Higashi).

closes: #21158

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-28 17:05:35 +00:00
Hirohito HigashiandClaude Opus 5 5ab969f719 patch 9.2.1015: Vim9: v:errmsg is set while looking ahead at a command
Problem:  In Vim9 script a line starting with a dict member is looked
          ahead at, to tell an assignment from an expression.  Where the
          expression runs on into the next line the lookahead cannot
          follow it, and what it makes of that reaches "v:errmsg" and
          whatever is being redirected, though nothing is wrong and the
          function compiles.
Solution: Turn error messages off around the lookahead instead of
          silencing them (Hirohito Higashi).

closes: #21168

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-27 21:15:58 +00:00
Hirohito HigashiandClaude Opus 5 4b0b53e856 patch 9.2.1008: Vim9: hang when a line break is used before "->("
Problem:  In Vim9 script a line break before "->(" makes Vim hang and
          use up memory (SectionCotangentBundle)
Solution: Consume the line break for "->(" as well, and skip white
          space after "->" in a compiled function too (Hirohito Higashi).

fixes:  #21144
closes: #21147

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-25 20:18:37 +00:00
Hirohito HigashiandClaude Opus 5 1f56c351de patch 9.2.1004: a completion function cannot tell why it was called
Problem:  A function used through 'omnifunc' or 'complete' is called the
          same way whether 'autocomplete' started the completion or a
          key asked for one, so it cannot answer differently.
Solution: Report which of the two it is in complete_info() as "auto". It
          is returned only when asked for in {what}, so what
          complete_info() says by itself does not change
          (Hirohito Higashi).

closes: #21143

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-25 19:38:27 +00:00
Hirohito HigashiandClaude Opus 5 bad7c5a77d patch 9.2.1003: popup: border is not shown when the popup does not fit
Problem:  A popup with a border loses part of the border when it does
          not fit on the screen: the right border is missing when a
          scrollbar is added, and the left border is missing when "pos"
          is right aligned and "fixed" is set (Mao-Yining).
Solution: Reserve a column for a scrollbar that is added after the width
          and the position were computed.  For a right aligned popup
          with "fixed", scroll the text instead of moving the border off
          the screen (Hirohito Higashi).

fixes:  #21128
closes: #21145

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-25 19:26:04 +00:00
Hirohito HigashiandClaude Opus 5 cb89033630 runtime(doc): some Blob functions are missing from blob-functions
blob2str(), str2blob(), base64_encode() and base64_decode() are only
listed under string-functions and channel-functions.  Also use "Blob"
consistently and say "bytes" instead of "numbers" for reverse().

closes: #21148

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-25 18:53:43 +00:00
Hirohito HigashiandClaude Opus 5 937992b143 patch 9.2.1000: Vim9: listener_add() fails when given only a callback
Problem:  In Vim9 script, listener_add() given only a callback fails
          with "E1212: Bool required for argument 3".
Solution: Check the third argument only when the second one is there.
          Without a second argument the third is not filled in, so
          what was checked was whatever happened to be in that slot
          (Hirohito Higashi).

closes: #21116

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-23 19:45:42 +00:00
Hirohito HigashiandClaude Opus 5 6308df41bf patch 9.2.0997: ch_sendexpr() cannot answer a request named with a string id
Problem:  A request that a server named with a string cannot be
          answered, since ch_sendexpr() rejects an "id" that is not a
          Number.
Solution: Require a Number only when Vim has to match a reply, which
          is with ch_evalexpr() or when a callback is given.  Send the
          message as it is otherwise (Hirohito Higashi).

fixes:  #14091
fixes:  #19003
closes: #21114
closes: #21126

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-23 18:47:52 +00:00
Hirohito HigashiandClaude Opus 5 2af3a6e151 patch 9.2.0992: popup filter gets the key at the hit-enter prompt
Problem:  When a popup with a filter is displayed and a message causes the
          hit-enter prompt, the key goes to the popup filter instead of the
          prompt.  The closed popup then stays on the screen, since there is
          no redraw while the prompt is up.
Solution: Do not invoke popup filters while Vim is waiting for a key at a
          prompt of its own.  Adjust Test_popup_filter_win_execute_error(),
          which relied on the filter getting the key at the prompt
          (Hirohito Higashi).

fixes:   #21052
closes:  #21068
related: #6999

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-20 21:26:07 +00:00
Hirohito HigashiandClaude Opus 5 775df1494a patch 9.2.0991: autocmd: events are triggered for what happened while they were ignored
Problem:  Events that are triggered by comparing the current state against a
          stored one are still reported once they are not ignored anymore.
          This shows up when a command sets 'eventignore', changes something
          and restores the option, since these events are only checked in
          the main loop, which does not run while a command executes.
Solution: Move the checks done in the main loop into a function and also
          call it when 'eventignore' or 'eventignorewin' changes, with the
          old value in effect.  What happened while an event was ignored is
          then not reported, and what happened before still is.

fixes:  #8641
closes: #21074

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-20 21:23:14 +00:00
Hirohito Higashi 76f1eed3a5 runtime(doc): clarify how setbufvar() handles window options
related: #21089
closes:  #21104

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-20 19:35:57 +00:00
Hirohito HigashiandClaude Opus 5 9647ccc020 patch 9.2.0981: substitute: wrong text after undo of a confirmed \r
Problem:  When a substitution is confirmed with the "c" flag and the
          replacement contains "\r", undo restores the whole original line
          while the lines already produced by earlier replacements stay,
          duplicating text (Masato Nishihata).
Solution: Replace the line before the next confirmation prompt, so that the
          line split and the replacement it belongs to end up in the same
          undo block (Hirohito Higashi).

fixes:  #4798
closes: #21092

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-19 20:21:57 +00:00
Hirohito HigashiandClaude Opus 5 f8799c5d0d patch 9.2.0979: terminal: mouse stays enabled after Vim is killed with SIGTERM
Problem:  After Vim is killed with a deadly signal such as SIGTERM the
          mouse stays enabled in the terminal, so moving the mouse
          afterwards produces escape sequences in the shell
          (Dominik George).
Solution: Switch the mouse off when exiting after a deadly signal.  The
          terminal mode is restored with "full_screen" already reset,
          which makes settmode() return before it can do this
          (Hirohito Higashi).

fixes:  #21090
closes: #21095

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-19 19:14:57 +00:00
Hirohito HigashiandClaude Opus 5 5ae1ad1298 patch 9.2.0978: terminal: empty lines don't use the background color of hl-terminal
Problem:  In a terminal window the empty lines are drawn without the
          background color that was set with hl-terminal, while the lines
          with text do use it (bfrg).
Solution: Stop clearing the window attribute on an empty line.  The Visual
          selection is already combined into the first cell of such a line,
          so the background color can be kept (Hirohito Higashi).

fixes:   #21087
related: #17559
related: #20547
closes:  #21093

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-19 18:59:58 +00:00
Hirohito HigashiandClaude Opus 5 e3eb025930 patch 9.2.0977: tests: test_terminal_visual_empty_listchars() is flaky
Problem:  tests: test_terminal_visual_empty_listchars() is flaky
Solution: Use WaitForAssert (Hirohito Higashi).

related: #21093

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-18 21:43:29 +00:00
Hirohito HigashiandClaude Opus 5 44a92018a5 patch 9.2.0975: Vim9: assignment to a member of an object member fails
Problem:  Using an operator on a member of an object that is itself a
          member of an object gives E909, and a plain assignment to it
          stores the value in the wrong member (Mao-Yining).
Solution: When the last index is split off from the name, forget the
          member index found for the first name.  The index is compiled
          before the variable, thus do not use the type that loading the
          variable produced.  Load the member of an object like an
          expression does instead of indexing it (Hirohito Higashi).

fixes:  #21084
closes: #21085

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-18 20:50:15 +00:00
Hirohito HigashiandClaude Opus 5 41ec8c6ed0 patch 9.2.0974: tests: Test_clientserver_serverlist_list() is flaky
Problem:  The test fails now and then, most often on MS-Windows. It uses the
          same server name as another test in the file, and Vim appends a
          number to the name when a server with that name is still running.
          The name is then checked with a match, which still succeeds, and
          with an exact comparison, which does not.
Solution: Use a name of its own and check the list with a pattern, so that a
          number appended to the name does not matter.

closes: #21083

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-18 20:44:05 +00:00
Hirohito HigashiandClaude Opus 5 08baca8abd translation: the ja.euc-jp.po file is generated wrong on macOS
Problem:  The macOS CI job fails now and then on the check of ja.euc-jp.po.
          The iconv of macOS turns a backslash that follows a multibyte
          character into a fullwidth one, which breaks the escaping. The
          file in the repository is correct, it is only regenerated when a
          checkout leaves ja.po newer, which is why the failure comes and
          goes.
Solution: Convert to EUC-JP-MS, which keeps the backslash and gives the same
          result otherwise.

closes: #21082

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-18 20:36:16 +00:00
Hirohito HigashiandClaude Opus 5 7a35445af1 patch 9.2.0973: Vim9: internal error when a class member is initialized with a closure
Problem:  Initializing an object variable with a closure gives an internal
          error when the constructor is called without arguments
          (Mao-Yining).
Solution: Do not use "any" as the type of an argument that was not set, and
          do not copy such an argument when the stack is copied for a
          closure (Hirohito Higashi).

fixes:  #21069
closes: #21081

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-18 20:31:12 +00:00
Hirohito HigashiandClaude Opus 5 6362cc82bb patch 9.2.0970: buffered listener cannot obtain the text of a change
Problem:  A callback added with listener_add() is given the line numbers of
          a change but not the text.  When changes are buffered, two changes
          to the same line do not change the line count and are reported
          together, so getbufline() can only return the result of the second
          one.
Solution: Let listener_add() take a Dictionary of options and add a "text"
          option, which stores the resulting text in each item of the list
          of changes.  The text is copied when the change is recorded, so it
          is not affected by later changes.  Invoke the callback early when
          a lot of text has been recorded, to bound the memory used.

related: #19621
closes:  #21071

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-18 19:34:57 +00:00
Hirohito HigashiandClaude Opus 5 21e9249838 patch 9.2.0968: status line height is wrong after exchanging or rotating windows
Problem:  Exchanging windows with CTRL-W x or rotating them with CTRL-W r
          leaves a window with the status line height of the other one, so
          with 'statuslineopt' the windows in a row no longer line up.
Solution: Keep the total height of each window when the status line height
          is exchanged, and compute the height needed for the status line of
          each window afterwards.

closes: #21079

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-18 17:52:21 +00:00
Hirohito HigashiandClaude Opus 5 795ee041f1 patch 9.2.0966: GTK4: window opens two lines too small
Problem:  On startup the GUI window is the height of the window decorations
          too small, so it shows two lines less than 'lines'.  It only gets
          the right size after the first pointer event.
Solution: Also request the shell size on the form widget, so that GTK derives
          the window height from it with the decorations included.  Drop the
          request again once the size was given, so that the window can still
          be made smaller (Hirohito Higashi).

closes: #21045

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-17 20:55:16 +00:00
Hirohito HigashiandClaude Opus 5 2e6a408f3b patch 9.2.0964: 'isprint' is applied to the leading byte of a character
Problem:  Excluding a value with 'isprint' also breaks the display of
          unrelated characters whose leading byte has that value.  After
          ":set isprint+=^226" the character U+222B is displayed as "<"
          (Emilien Breton).
Solution: Apply 'isprint' to the character value only, not to the leading
          byte of its UTF-8 encoding (Hirohito Higashi).

fixes:  #21053
closes: #21055

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-17 20:35:13 +00:00
Hirohito HigashiandClaude Opus 5 d8b0e5bd4a patch 9.2.0959: tests: Test_xrestore() is flaky and cannot recover
Problem:  Test_xrestore() fails on CI and the retry fails as well, because
          the retry runs in the same Vim and the connection to the X server
          was not restored.
Solution: Restore the display in a "finally" block.  Wait for the selection
          to become available instead of failing with E353.

closes: #21066

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-17 18:53:47 +00:00
h-east 3cd5d1d1aa Revert "buffered listener cannot obtain the text of a change"
This reverts commit 9ce6801812.
2026-08-17 17:48:28 +09:00
h-eastandClaude Opus 5 9ce6801812 buffered listener cannot obtain the text of a change
Problem:  A callback added with listener_add() is given the line numbers of
          a change but not the text.  When changes are buffered, two changes
          to the same line do not change the line count and are reported
          together, so getbufline() can only return the result of the second
          one.
Solution: Let listener_add() take a Dictionary of options and add a "text"
          option, which stores the resulting text in each item of the list
          of changes.  The text is copied when the change is recorded, so it
          is not affected by later changes.  Invoke the callback early when
          a lot of text has been recorded, to bound the memory used.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-17 17:46:22 +09:00
h-east 4e0cd139cb Revert "tests: Test_xrestore() is flaky and cannot recover"
This reverts commit 0912ec20b8.
2026-08-17 04:38:22 +09:00
h-eastandClaude Opus 5 0912ec20b8 tests: Test_xrestore() is flaky and cannot recover
Problem:  Test_xrestore() fails on CI and the retry fails as well, because
          the retry runs in the same Vim and the connection to the X server
          was not restored.
Solution: Restore the display in a "finally" block.  Wait for the selection
          to become available instead of failing with E353.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-17 04:29:58 +09:00
Hirohito HigashiandClaude Opus 5 d4703e569d patch 9.2.0958: Vim9: wrong type for the rest of a tuple in an unpack assignment
Problem:  In an unpack assignment the variable after the ";" gets the type
          of the whole tuple instead of the type of the remaining items.
          When the assigned value has type "any" it even gets a list type,
          so that a tuple cannot be assigned to it later (Mao-Yining).
Solution: Give the variable the type of the remaining items.  Keep "any"
          when it is not known whether a list or a tuple is assigned
          (Hirohito Higashi).

fixes:  #21057
fixes:  #21058
closes: #21059

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-16 15:46:32 +00:00
Hirohito Higashi a0f057dacf runtime(doc): Tweak documentation style a bit
closes: #21061

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-16 15:38:18 +00:00
Hirohito HigashiandClaude Opus 5 fc6288f517 patch 9.2.0956: GTK4: crash when the window is resized while redrawing
Problem:  In GTK4, Vim may crash when the window is resized while the
          cursor is displayed.
Solution: Remember the number of cells the cursor covers when the cursor
          is set, instead of deriving it from the drawing position when
          the snapshot is taken (Hirohito Higashi).

fixes:  #21037
closes: #21038

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-12 21:45:46 +00:00
Hirohito HigashiandClaude Opus 5 fa96c9ea30 patch 9.2.0955: tests: terminal tests are flaky
Problem:  Test_terminal_aucmd_on_close() is flaky on MS-Windows: the
          tests that wait for a terminal window to close use a timeout
          shorter than the default, which is not enough when starting a
          process is slow.  When the wait fails the test aborts with
          E121 and leaves an autocommand behind for the following tests.
          Test_terminal_unwraps() checks the buffer contents without
          waiting for the job to finish.
Solution: Use the default timeout of WaitForAssert(), initialize the
          variable checked after the wait, and wait for the buffer to
          hold the unwrapped line.

closes: #21039

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-12 21:40:50 +00:00
Hirohito HigashiandClaude Opus 5 ecfea491aa patch 9.2.0954: u_read_undo() can be improved (after 9.2.0935)
Problem:  u_read_undo() has comments that do not add anything to what
          the code says (afte rv9.2.0935).
Solution: Drop the redundant comments (Hirohito Higashi).

related: #20942
closes:  #21028

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-12 20:21:43 +00:00
Hirohito HigashiandClaude Opus 5 4dde4afa1d patch 9.2.0953: insert completion code can be improved
Problem:  The duplicate-check hashtab in insexpand.c has comments that
          do not add anything to what the code says (after v9.2.0909).
Solution: Drop the redundant comments.

related: #20926
closes:  #21027

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-12 20:17:36 +00:00
Hirohito HigashiandClaude Opus 5 1af1744129 patch 9.2.0952: locking a container while stringifying can be improved
Problem:  The comments on locking a list or dict while stringifying its
          items say the same thing three times over, and at more length
          than the existing comments on the same construct
          (after v9.2.0936).
Solution: Shorten them.

related: #21001
closes:  #21029

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-12 20:08:18 +00:00
Hirohito HigashiandClaude Opus 5 fe65307d49 patch 9.2.0950: transstr() can be improved (after 9.2.0906)
Problem:  transstr() has comments that do not add anything to what the
          code says, and it casts a length to int only to cast it back to
          size_t.
Solution: Drop the comments and keep the length in a size_t
          (Hirohito Higashi).

related: #20925
closes:  #21026

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-12 19:47:43 +00:00
Hirohito HigashiandClaude Opus 5 9a5aa22e76 patch 9.2.0948: GTK4: mouse move starts Visual selection after a dialog
Problem:  In GTK4, when a dialog pops up while a mouse button is pressed,
          moving the mouse afterwards starts a Visual selection without
          any button being held down.
Solution: Forget about the pressed mouse button when a mouse move reports
          that no button is down, since the button release event may have
          gone to another widget (Hirohito Higashi).

related: #20907
related: #21014
closes:  #21022

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-12 19:11:17 +00:00
Hirohito HigashiandClaude Opus 5 62cf642965 patch 9.2.0947: GTK4: screen is cleared when moving the mouse after startup
Problem:  In GTK4, moving the mouse over the window right after startup
          clears the screen, including the intro message.
Solution: Keep the cached contents of the drawing area in sync with the
          size Vim is going to draw (Hirohito Higashi).

fixes:  #21016
closes: #21021

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-12 19:05:26 +00:00