Problem: As stated in :help i_CTRL-X_CTRL-F, 'path' is not yet used for
filename completion.
Solution: Add EW_PATH flag in expand_wildcards of
get_next_filename_completion() (Fabian Wermelinger).
* Add new "pathopt" in 'completeopt' to enable 'path' consultation during
filename completion (not enabled by default).
* Add a new Test_ins_complete_files_in_path case for test_ins_complete.
* Update corresponding runtime/doc files.
closes: #21445
Signed-off-by: Fabian Wermelinger <fabian@git.0xfab.ch>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim syntax highlighting can sometimes be a bit slow, and it
might be unclear as to why.
Solution: Document a couple of tips to speed up syntax highlighting.
related: #21513
closes: #21572
Signed-off-by: jvoisin <julien.voisin@dustri.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: After a forced blockwise exclusive motion that makes a
one-column block, such as "d<C-V>`x" with the mark at the
cursor, "d" and "c" do nothing.
Solution: Do not use the inclusive flag to find an empty region for a
block, because "oap->end" is already the last column of the
block (Nagato Yuzuru).
fixes: #21547
related: #21540
related: neovim/neovim#24613
closes: #21548
Assisted-by: Claude
Signed-off-by: Nagato Yuzuru <nagato@yuzuru.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Error E1016 is used for 2 different things
(Ivan Pešić)
Solution: Use E1000 for the environment variable error.
fixes: #21522closes: #21538
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: crash when a type is nested very deeply, e.g.
"list<list<...>>" nested 100000 times, either directly or by
using type aliases, because of running out of stack space.
Solution: Give an error when a type is nested more than 1000 times,
including nesting through type aliases (Yegappan Lakshmanan).
fixes: #21566closes: #21498
Assisted-by: Claude
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: when a nested generic function is called with type
arguments, the type arguments are not used, e.g. the argument
types are not checked. Using it in a lambda gives a wrong
error and a type variable with the name of the function is not
rejected.
Solution: Create the function with the type arguments in the context of
the function where it is defined, also when used in a closure
or in a recursive call. Skip over type arguments of a
function name in an expression that is not evaluated. Check
the type variable names of a nested generic function
(Yegappan Lakshmanan).
When used in a closure or in a recursive call, the partial for the
function with the type arguments uses the context of the function where
the generic function is defined, which is found by going up the outer
partials.
fixes: #21565closes: #21496
Assisted-by: Claude
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: when a class implements a generic method of an
interface, the number of type variables is not checked, unlike
when a method is overridden in a child class.
Solution: Give an error when the number of type variables differs
(Yegappan Lakshmanan).
fixes: #21564closes: #21495
Assisted-by: Claude
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
While at it, also fix E716 when calling gnat.Get_Command('Find')
by renaming the key from 'Find_Program' to the expected 'Find_Command'.
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The dry run feature received negative feedback
Solution: Revert patches 9.2.1140 and 9.2.1084.
This reverts commit v9.2.1140 (6175ce8762) and
v9.2.1084 (e376846379).
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
Problem: Following the instructions manpager.vim's help does not work
for mandoc's man frontend
Solution: Explain how to set up MANPAGER for mandoc (Luca Del Re)
closes: #21424
Signed-off-by: Luca Del Re <v.commit@ldr.name>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: the image feature can be improved
Solution: Refactor the image feature, make use of the pixman library if
possible, add image_info(), image_add() and image_discard()
functions and the 'imageprotocol' option (Foxe Chen)
closes: #21234
Assisted-by: Claude
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
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>
Problem: Vim9: no unreachable error when every branch returns
Solution: Track termination for all branches and give E1095.
(Yegappan Lakshmanan).
closes: #21407
Assisted-by: GitHub Copilot
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: luaV_blob_index() and luaV_blob_newindex() only check the upper
bound of the index (Yuyao Jiang).
Solution: Handle a negative index as relative to the end, like Vim does.
related: #21373
Assisted-by: Claude Opus
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
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>
- Terminate :global patterns, and :substitute patterns and replacement
text, at EOL. The closing delimiter is optional.
- Clarify the behaviour of optional pattern terminators in the :global
and :substitute help sections.
related: #21132
closes: #21367
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: icalendar files are not recognized
Solution: Detect *.ics files as icalendar filetype, include
syntax and filetype plugins (Anakin Childerhose).
Reference:
https://datatracker.ietf.org/doc/html/rfc5545closes: #21356
Assisted-By: Claude Opus 5
Signed-off-by: Anakin Childerhose <anakin@childerhose.ca>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Virtual text breaks cursor movement when 'virtualedit' is set
to "all" (Yamagi)
Solution: Count the screen space occupied by virtual text when
calculating the cursor position (Yamagi).
getvcol() counted the width of virtual text above a line in the end and
cursor column of the line's first character, but not in its start
column. Now all three include it, which also corrects what screenpos()
and virtcol([lnum, col], 1) returns for that character with any
'virtualedit': the row of the buffer text instead of the row of the
virtual text, and its start column instead of column 1. Callers wanting
the columns of the buffer text only pass the new GETVCOL_NO_ABOVE flag.
Whether getvcol() sets "w_virtcol_first_char" was decided by comparing
its "cursor" argument with "&wp->w_virtcol". That never matched while
virtual_active() is true, which is not only the case with "all", but
also for a blockwise Visual selection, in Insert mode and while an
operator is running. The new GETVCOL_FOR_VIRTCOL flag says what the
value is used for instead.
fixes: #14049closes: #21336
Assisted-By: Claude Opus 5
Signed-off-by: Yamagi <yamagi@yamagi.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: 'tagfunc' not used for tag completion
(Daniel J. Perry)
Solution: Remove TAG_NO_TAGFUNC from expand_tags() (Rob Pilling),
add a few more tests for side effects.
fixes: #12039closes: #21316
Signed-off-by: Rob Pilling <robpilling@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: getregionpos() returns a pair of positions for every line, so
obtaining just the outer endpoints of a region costs O(lines);
for a 100000 line region that is about 1.4 million list
allocations for a result of which the caller keeps two
positions.
Solution: Add a "bounds" item to {opts} that returns a single pair with
the start on the first line and the end on the last line
(Volodymyr Chernetskyi).
The lines in between do not influence the outer endpoints, so with
"bounds" they are not visited at all. The two positions then come from
different lines and describe a diagonal of the region rather than its
shape; for a blockwise region they are the start of the first line and
the end of the last line, not the corners of the block. This is exactly
what indexing the full result gives, so the awkward corners are kept as
they are, including an empty first line yielding a "col" of 0 for the
start while the end keeps its own column.
On a 100000 line buffer this takes getregionpos() from about 45 ms to
about 0.003 ms per call.
closes: #21209
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Volodymyr Chernetskyi <19735328+chernetskyi@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #21217closes: #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>
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>
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>
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>
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>
Problem: CursorLineFold and CursorLineSign are only applied when
'cursorlineopt' contains "number" or is "both"
(Evgeni Chasnovski).
Solution: Apply those groups whenever 'cursorline' is set, independent
of 'cursorlineopt' (Vrushali Zampalkar).
fixes: #20480closes: #21112
Signed-off-by: Vrushali Zampalkar <vzampalk@vzampalk-thinkpadt14gen5.punetw6.csb>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #21235closes: #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>
Problem: using wrong printing font, adding too much vertical space
(Gary Johnson, after v9.2.0898)
Solution: Change the font back to Courier 10, update the character
height (Foxe Chen)
fixes: #21203closes: #21206
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>