Problem: keyword completion does not work with fuzzy
(egesip)
Solution: handle ctrl_x_mode_normal() specifically
(glepnir)
fixes: #15412closes: #15424
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: xxd: cannot use -b and -i together
(Irgendwer)
Solution: implement the missing changes
(Andre Chang)
fixes: #15362closes: #15661
Signed-off-by: Andre Chang <andre@augmentcode.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: inconsistent case sensitive extension matching
Solution: unify case sensitive extension matching (Evgeni Chasnovski).
There are different approaches of how extensions are matched with
respect to case sensitivity. In particular, '\c' flag is used in pattern
whereas in most places case sensitive matching is guarded behind
`has("fname_case")` condition.
Replace all instances of '\c' with an explicit case sensitive pattern
variants guarded by `has("fname_case")`. Strictly speaking, this is a
breaking change because only two (most common and prevailingly tested)
variants are now matched: upper first letter and upper all letters.
closes: #15672
Signed-off-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Crash with cursor-screenline and narrow window
(elig0n)
Solution: Don't set right_col when width2 is 0 (zeertzjq).
fixes: #15677closes: #15678
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: heap-use-after-free in garbage collection with location list
user data.
Solution: Mark user data as in use when no other window is referencing
the location list (zeertzjq)
fixes: neovim/neovim#30371
closes: #15683
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: too many strlen() calls in option.c
Solution: refactor the code to reduce the number of strlen() calls
(John Marriott)
closes: #15604
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: not using correct python3 API with dynamic linking
Solution: Use stable IncRef / DecRef in Python 3 dynamic bindings
(Yee Cheng Chin)
Previously, we were using the Py_DECREF macros even when using dynamic
linking of Python 3. This caused issues because Python's headers contain
references to internal APIs like `_Py_Dealloc` and in v8.1.2201 and
v8.2.1225 we simply hacked around the issue by manually copying the
Python header implementation to Vim and linking in the private APIs.
This is fragile and prone to break. In fact, the Py_DECREF
implementation is different in newer versions of Python meaning that
this could potentially cause memory issues.
Instead, simply use the API versions (`Py_DECREF` and `Py_INCREF`) which
are functions exposed by the Python library. They could be slightly
slower since they require a function call instead of a macro, but are
much more reliable and we should only be calling these when the Python
Vim plugins are crossing the language boundary anyway which are always
going to be slow.
Note that this only affects dynamically linked Python builds that are
not using stable ABI.
Also see #15648closes: #15653
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: swiftinterface files are not recognized
Solution: Detect '*.swiftinterface' files as swift filetype
(LosFarmosCTL)
closes: #15658
Signed-off-by: LosFarmosCTL <80157503+LosFarmosCTL@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: if_python: link error with python 3.13 and stable ABI
(zdohnal)
Solution: Use the correct stable APIs Py_IncRef and Py_DecRef instead
(Yee Cheng Chin)
This fixes#15460 properly. There was an attempt to fix it in v9.1.0668,
but it did it by manually copy and pasting definitions from Python 3.13
headers, which is problematic as it makes Vim dependent on low-level
implementation details which are subject to change. That change also
pulls in dependencies to private APIs (`_Py_IncRef`) which is a very bad
idea as the next version of Python could very well remove that.
The core issue was simply that `Py_INCREF` and similar functions are not
part of the stable API. We are supposed to be using `Py_IncRef` instead
which performs null-check (similar to `Py_XINCREF`) and is available as
a linkable function. We simply need to call it instead of the macro.
We simply remap `Py_INCREF` (and friends) to the function version in
stable API similar to how we mapped other functions.
related #15460closes: #15648
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: if_python: dynamic linking fails with python3 >= 3.13
when using non-stable ABI (zdohnal)
Solution: do not try to import the privat python symbol
_PyObject_NextNotImplemented
(Yee Cheng Chin)
Vim is importing a private Python symbol `_PyObject_NextNotImplemented`
because it used to be required as part of the `PyIter_Check()` macro in
an abstraction breaking way. Python eventually fixed the issue and in
3.13 it removed the private symbol export, which broke Vim. Simply
remove importing this private symbol in newer Python versions as it's no
longer needed for PyIter_Check to work.
fixes: #15457closes: #15649
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: crash with large id in text_prop interface
prop_add()/prop_add_list() (cposture)
Solution: Error out if the id is > INT_MAX or <= INT_MIN
fixes: #15637closes: #15638
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_mksession does not consider XDG_CONFIG_HOME
Solution: allow to match $HOME/.vim/ and $HOME/.config/vim for &viewdir
(John M Devin)
closes: #15639
Signed-off-by: John M Devin <john.m.devin@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Wrong breakindentopt=list:-1 with multibyte chars or TABs in
text matched by 'formatlistpat' (John M Devin)
Solution: Use the width of the match text (zeertzjq)
fixes: #15634closes: #15635
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Resetting cell widths can make 'listchars' or 'fillchars'
invalid.
Solution: Check for conflicts when resetting cell widths (zeertzjq).
closes: #15629
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: hard to guess the Vim Runtime Directory
Solution: Set the $MYVIMDIR environment variable to the users
personal runtime directory (e.g. ~/.vim on Linux)
closes: #15576
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Unnecessary nextcmd NULL checks in parse_command_modifiers().
Solution: Remove them (zeertzjq)
Every place parse_command_modifiers() is called, nextcmd is NULL, and
after it's set to non-NULL the function returns very soon.
Even if one day nextcmd may be non-NULL, the NULL checks may still be
wrong as the correct behavior may be overriding nextcmd.
closes: #15620
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Not correctly parsing color names (chdiza, after v9.1.0709)
Solution: Revert part of the patch that compares the color names and
fall-back to the macro STRICMP
fixes: #15617closes: #15619
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: GuiEnter_Turkish test may fail
Solution: the message will be translated if the Turkish message file is
installed. Use gettext() to get the expected message
(Ken Takata)
closes: #15615
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Newline causes E749 in Ex mode (after 9.1.0573).
Solution: Don't execute empty command followed by a newline.
closes: #15614
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: missing dependency of Test_gettext_makefile
Solution: Check that xgettext binary is available, else skip the test
(James McCoy)
closes: #15612
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_xxd may file when using different xxd
Solution: Make Test_xxd_color_0 agnostic to xxd's path, similar to
Test_xxd_color_1 by filtering out shell command prompt in
screen dump file (James McCoy)
If an alternative xxd path is provided, e.g., the system installed xxd,
then the screen dump fails due to the difference in path.
From test_xxd.vim:
Found errors in Test_xxd_color2():
Run 1, 15:17:03 - 15:17:04:
command line..script /tmp/autopkgtest-lxc.1auv5tlk/downtmp/autopkgtest_tmp/vim/src/testdir/runtest.vim[607]..function RunTheTest[57]..Test_xxd_color2[36]..VerifyScreenDump line 67: See dump file difference: call term_dumpdiff("testdir/failed/Test_xxd_color_0.dump", "testdir/dumps/Test_xxd_color_0.dump"); difference in line 1: "|$+0&#ffffff0| |/|u|s|r|/|b|i|n|/|x@1|d| |-|R| |n|e|v|e|r| @1|<| |X@1|D|f|i|l|e|_|c|o|l|o|r|s| @33"
related: #15612
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: when a popup window covers the command line,
the command line is not completely cleared on popup_hide()
(yu3s)
Solution: Check if the popup window covers the command line and if it
does, set the clear_cmdline flag.
fixes: #15608closes: #15610
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: GUIEnter not found in Turkish locale
(James McCoy, after v9.1.0256, the issue was there before,
but v9.1.0256 made it more apparent)
Solution: explicitly compare autocommand events by ASCII value and
ignoring locale, because according to the documentation,
events are case insensitive (:h autocommand-events)
fixes: #15574closes: #15603
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Window is updated with potentially invalid skipcol in recursive
window update path. I.e. cursor outside of visible range in
large line that does not fit.
Solution: Make sure it is valid (Luuk van Baal).
closes: #15605
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: [security]: invalid cursor position may cause a crash
(after v9.1.0038)
Solution: Set cursor to the last character in a line, if it would
otherwise point to beyond the line; no tests added, as it
is unclear how to reproduce this.
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4ghr-c62x-cqfh
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_gettext fails when using shadow dir
Solution: Link the ru_RU directory into the shadow testdir
(James McCoy)
Link the ru_RU directory into shadow testdir
When the ru_RU locale is present, but the build is using a shadowdir,
then test_gettext_cp1251.vim and test_gettext_utf8.vim fail:
From test_gettext_cp1251.vim:
Executed Test_gettext() in 0.000848 seconds
Executed 1 test in 0.007010 seconds
1 FAILED:
Found errors in Test_gettext():
command line..script /home/runner/work/vim/vim/src/shadow/testdir/runtest.vim[607]..function RunTheTest[57]..Test_gettext line 9: Expected '������: ' but got 'ERROR: '
From test_gettext_utf8.vim:
Executed Test_gettext() in 0.000908 seconds
Executed 1 test in 0.007339 seconds
1 FAILED:
Found errors in Test_gettext():
command line..script /home/runner/work/vim/vim/src/shadow/testdir/runtest.vim[607]..function RunTheTest[57]..Test_gettext line 9: Expected '������: ' but got 'ERROR: '
This is because it's unable to load the translations from the ru_RU test
directory, since it wasn't symlinked into the shadow directory.
closes: #15591
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Sorting of fuzzy filename completion is not stable
Solution: Compare indexes when scores are equal. Fix some typos.
(zeertzjq)
closes: #15593
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: inserting with a count is inefficient
Solution: Disable calculation of the cursor position and topline, if a
count has been used (Ken Takata)
Optimize insertion when using :normal 10000ix.
This patch optimizes the insertion with a large count (e.g. `:normal
10000ix`).
It seems that calculation of the cursor position for a long line is slow
and it takes O(n^2). Disable the calculation if not needed.
Before:
```
$ time ./vim --clean -c 'normal 10000ix' -cq!
real 0m1.879s
user 0m1.328s
sys 0m0.139s
$ time ./vim --clean -c 'normal 20000ix' -cq!
real 0m5.574s
user 0m5.421s
sys 0m0.093s
$ time ./vim --clean -c 'normal 40000ix' -cq!
real 0m23.588s
user 0m23.187s
sys 0m0.140s
```
After:
```
$ time ./vim --clean -c 'normal 10000ix' -cq!
real 0m0.187s
user 0m0.046s
sys 0m0.093s
$ time ./vim --clean -c 'normal 20000ix' -cq!
real 0m0.217s
user 0m0.046s
sys 0m0.108s
$ time ./vim --clean -c 'normal 40000ix' -cq!
real 0m0.278s
user 0m0.093s
sys 0m0.140s
$ time ./vim --clean -c 'normal 80000ix' -cq!
real 0m0.494s
user 0m0.311s
sys 0m0.140s
$ time ./vim --clean -c 'normal 160000ix' -cq!
real 0m1.302s
user 0m1.140s
sys 0m0.094s
```
closes: #15588
Signed-off-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: possible crash with 2-byte encoding and glob2regpat()
(after v9.1.0700, v9.1.0702)
Solution: include both bytes for a multi-byte character for an
escaped character
closes: #15590
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: crash with NFA regex engine when searching for composing chars
(SuyueGuo)
Solution: When there is no composing character, break out of the loop
and check that out1 state is not null
fixes: #15583
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: possible crash with 2byte encoding and glob2regpat()
Solution: Skip over character, if it is multi-byte character
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: "dvgo" is not always an inclusive motion
(Iain King-Speir)
Solution: initialize the inclusive flag to false
fixes: #15580closes: #15582
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: "Untitled" file not removed when running Test_crash1_3 alone
with TEST_FILTER (after v9.1.0695)
Solution: Use a TearDown function instead of another test.
(zeertzjq)
closes: #15578closes: #15577
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: heap-buffer-overflow in ins_typebuf
(SuyueGuo)
Solution: When flushing the typeahead buffer, validate that there
is enough space left
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4ghr-c62x-cqfh
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: installing runtime files fails when using SHADOWDIR
Solution: revert part of v9.1.0609, since runtime/doc/Makefile's default
value for VIMPROG does not work if vim was built in a SHADOWDIR.
(James McCoy)
closes: #15575
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_crash leaves Untitled file around
Solution: cleanup at the end of the test_crash.vim test file
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The matchparen plugin is slow on a long line.
Solution: Don't use a regexp to get char at and before cursor.
(zeertzjq)
Example:
```vim
call setline(1, repeat(' foobar', 100000))
runtime plugin/matchparen.vim
normal! $hhhhhhhh
```
closes: #15568
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Configure doesn't show result when not using python3 stable
abi (after v9.1.0691)
Solution: Add back AC_MSG_RESULT() (Ken Takata)
related: #15555
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Wrong patlen value in ex_substitute() (after 9.1.0426).
Solution: Compute patlen after finding end separator.
(zeertzjq)
Add a more explicit test. The test already passes as the only case
where a overlarge patlen value matters was fixed by patch 9.1.0689.
closes: #15565
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: python3: stable-abi may cause segfault on Python 3.11
(Audrius Kažukauskas, after v9.1.0668)
Solution: do not enable the stable Python ABI by default, only when used
with --with-python3-stable-abi argument is given
related: #15543
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cannot set special highlight kind in popupmenu
Solution: add kind_hlgroup item to complete function
(glepnir)
closes: #15561
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: buffer-overflow in do_search() with 'rightleft'
(SuyueGuo)
Solution: after reversing the text (which allocates a new buffer),
re-calculate the text length
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-v2x2-cjcg-f9jm
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: dereferences NULL pointer in check_type_is_value()
(Suyue Guo)
Solution: Verify that the pointer is not Null
fixes: #15540closes: #15545
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Makefile may not install desktop files
Solution: Check for "$(DESTDIR)$(DATADIR)" instead of just "$DESTDIR",
which is usually not defined, add uninstall rules for the
icons and the desktop files
closes: #15528fixes: #15546
Signed-off-by: Christian Brabandt <cb@256bit.org>