The required space in Vim9 continuation comments (#\ comment) was
accidentally removed in commit 6acca4b as trailing whitespace.
closes: #17573
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: inconsistent range arg for :diffget/diffput
Solution: fix the range specification, place the cursor for :diffput and
:diffget consistently on the last line (Yee Cheng Chin)
Previously, `:<range>diffget` only allowed using 1 or above in the range
value, making it impossible to use the command for a diff block at the
beginning of the file. Fix the range specification so the user can now
use 0 to specify the space before the first line. This allows
`:0,$+1diffget` to work to retrieve all the changes from the other file
instead of missing the first diff block. Also do this for `:diffput`.
Also, make `:diffput` work more similar to `:diffget`. Make it so that
if the cursor is on the last line and a new line is inserted in the
other file, doing `:diffput` will select that diff block below the line,
just like `:diffget` would.
Also clean up the logic a little bit for edge cases and for handling
line matched diff blocks better.
closes: #17579
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: if_python: PySequence_Fast_{GET_SIZE,GET_ITEM} removed with
python3.14 in stable ABI
Solution: use PySequence_{Size,GetItem} instead (Zdenek Dohnal)
Python 3.14 removed those two functions from stable API because of
reasoning these function shouldn't be part of stable API at the first
place.
Moving to PySequence_GetSize and PySequence_GetItem fixes the build
failure when Vim is built with dynamic Python and stable API for Python
3.8.
closes: #17575
Signed-off-by: Zdenek Dohnal <zdohnal@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The 'h' occasion is now used for "matched text of currently inserted
completion" (defaulting to ComplMatchIns).
closes: #17572
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: use-after-free with popup callback on error
(Brian Carbone, lifepillar)
Solution: check if the popup window is valid before accessing it
fixes: #17558closes: #17565
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: potential buffer-underflow with invalid hl_id (mugitya03)
Solution: assert that the return-code of syn_get_final_id() if > 0
As a safety check, syn_get_final_id() may return zero when either the
provided hl_id is zero or larger than expected.
However, many callers of syn_get_final_id() do not check that the return
value is larger than zero but re-use the returned highlight id directly
like this:
hl_id = syn_get_final_id(hl_id);
sgp = &HL_TABLE()[hl_id - 1]; // index is ID minus one
in which case, this would cause a buffer underrun and an access violation.
Let's use assert(hl_id > 0); to make sure that hl_id is larger than
zero.
Note to myself: I'll need to compile releases builds using -DNDEBUG once
a new release will be made
fixes: #17475closes: #17512
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: bright(er)script files are not recognized
Solution: detect *.bs files as brighterscript filetype and *.brs as
brightscript filetype, include filetype plugins (Riley Bruins)
closes: #17566
Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: too many strlen() calls
Solution: Change expand_env() to return string length
(John Marriott)
This commit does the following changes:
- In expand_env_esc():
- return the length of the returned dst string.
- refactor to remove some calls to STRLEN() and STRCAT()
- add check for out-of-memory condition.
- Change call sites in various source files to use the return value
closes: #17561
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
There is no pattern after the user event name. The user event name is
the pattern.
closes: #17568
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: not all lex files are recognized
Solution: detect *.ll as lex, llvm or lifelines filetype, depending on
the content (Eisuke Kawashima)
closes: #17560
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: gv does not work in operator-pending mode
(liushapku)
Solution: remove the check for checkclearop in nv_gv_cmd()
(phanium)
fixes: #3666closes: #17551
Signed-off-by: phanium <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: missing change from patch v9.1.1461
Solution: change wrong TPL_LCOL macro in a few more places
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: vimtutor throws Access Denied Error
Solution: switch the order of redirects. First redirect stdout, than
stderr to stdout, Try to access $TEMP before current directory
(which is usually c:\Program Files\vim\vim91\ and not writable
for normal users)
closes: #17550
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tabpanel: tabpanel vanishes with popup menu
Solution: remove pum-related test in tabpanel_leftcol(), refactor a few
related functions (Hirohito Higashi)
This commit does the following:
- Delete unnecessary pum-related checks in the tabpanel_leftcol()
function
- remove pum-related check in tabpanel_leftcol()
- The argument of the TPL_LCOL() macro has been deleted.
- The argument of the tabpanel_leftcol() function has been changed
to void
- The return type of the `win_comp_pos()` function has been changed to
void
closes: #17549
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: too many strlen() calls in os_win32.c
Solution: refactor code and remove calls to strlen() and wcscat()
(John Marriott)
This commit does the following changes:
- in mch_get_exe_name():
- refactor to remove call to wcsrchr().
- refactor to replace calls to wcscat() with wcscpy().
- move variables closer to where they are used.
- change test to make sure that concatenating path and exe_pathw
will fit inside the environment string (taking into account that
path may be NULL).
- in executable_exists():
- add namelen argument.
- use string_T to store some strings.
- refactor to remove calls to STRLEN() (via STRCAT()).
- in mch_getperm():
- move call to mch_stat() into return statement and drop unneeded
variable.
- in mch_wrename():
- refactor to use wide character comparisons.
- some cosmetic code styling changes (removing extraneous spaces, etc).
closes: 17542
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: xxd prints color escape sequences for every octet
even if the color doesn't change
Solution: use separate arrays for colors and text and only
print escape sequences when the color changes
(Emanuel Krollmann)
fixes: #15122closes: #17535
Signed-off-by: Emanuel Krollmann <E.Krollmann@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Make sure comment toggling works when 'commentstring' contains
any of the following regex special characters by escaping them:
^ $ [
closes: #17537
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
closes: #17525
Signed-off-by: Yuqian Yang <crupest@crupest.life>
Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This change was forgotten from commit 6f6c0dba9f578787
closes: #17536
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: comment plugin fails toggling if 'cms' contains \
Solution: escape backslash (Maxim Kim)
groff could be commented using \" or \# and comment plugin fails to
uncomment such things.
NOTE: if newstyle comment would be introduced, e.g. .\#
for groff test would need to be adjusted.
closes: #17530
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
I cannot reproduce this defect. The replication instructions refer to
Mercurial version numbers and I no longer use Mercurial for my Vim
source. I tried comparing various Git versions of the example file,
src/if_cscope.c, and still couldn't reproduce the defect. Also, I use
Vim's diff mode a lot and haven't seen such a problem in a long time.
I am confident that it has been fixed.
Therefore, the item should be removed from todo.txt.
closes: #17534
Signed-off-by: Gary Johnson <garyjohn@spocom.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Haiku: dailog objects created with no reference
Solution: delete the objects before returning (jinyaoguo)
In the functions gui_mch_dialog() and gui_mch_font_dialog(), Dialog
objects are created but never escape the function scope. The call to
dialog->Go() only returns a boolean value and does not retain any
reference to the Dialog object itself, which may lead to potential
memory leak.
Fix this by deleting the object after using it.
closes: #17501
Signed-off-by: jinyaoguo <guo846@purdue.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Fix highlighting of function names including /fu\%[nction]/ (E.g.,
s:func(), foo.fu(), fu.func())
- Match :delfunction argument.
Reported by Aliaksei Budavei.
closes: #17428
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Missing test case for pum display on a wrapped line.
Solution: Add a test case to cover pum behavior at line break positions.
(glepnir)
closes: #17520
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Use <f-args> instead of <q-args> in commands:
- :Open
- :Launch
- :URLOpen
fixes#17468closes: #17517
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Before this commit, I had trouble finding information about configuring
the insert mode completion. In particular, it was not clear that the
'wildopt' config that I already had in my vimrc does not apply here.
Also, `insert.txt` barely mentioned 'completeopt' except when
describing popups (I was more interested in bash-like behavior
where the unique prefix of all completions is completed first).
I'm hoping these edits will make the relevant docs easier to find.
closes: #17515
Signed-off-by: Ilya Grigoriev <ilyagr@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_geometry() may fail
(Gary Johnson)
Solution: allow a slightly smaller value when checking the number of
lines.
fixes: #17491
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Some filetype autocmds with patterns ending in * do not skip
filenames matching g:ignored_patterns.
Solution: Move these autocmds to the appropriate section and call
s:StarSetf() to set the filetype.
- Affected filetypes: dosini, execline, foam, messages, nginx, tmux.
- Convert foam filetype patterns to use wildcard matching.
closes: #17422
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Limit heredoc matches to assignment statements. Matching these at the
top level is very slow.
closes: #17473
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>