Problem: Match highlighting marks a buffer region to be redrawn as if
its buffer text was changed, unnecessarily invoking syntax code.
Solution: Set the `w_redraw_top/bot` variables instead of the b_mod_* ones
(Luuk van Baal)
closes: #16697
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
When adding new highlight groups, one needs to make sure to also add a
"default link NewHlGroup ExistingHlGroup" in highlight.c code, so that
when resetting a color scheme the old color won't be left behind.
So add a Makefile in the 'ci' directory that verifies that all
documented '*hl-<groupname>' from the documentation are either reflected
in the source code, or belong to a list of 'known to be ignored'
highlight groups and let that check run as part of the CI test suite.
related: #16676closes: #16678
Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: Guile init file not recognized
Solution: detect '.guile' file as scheme filetype
(David Mandelberg)
References:
https://www.gnu.org/software/guile/manual/html_node/Init-File.html
> When run interactively, Guile will load a local initialization file
> from ~/.guile. This file should contain Scheme expressions for
> evaluation.
closes: #16683
Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: potential out-of-memory issue in search.c
Solution: improve situation and refactor search.c slightly
(John Marriott)
- In function update_search_stat():
add a check for a theoretical null pointer reference, set and remember
the length of lastpat, remove the three calls to STRLEN() and use the
various string's associated lengths instead, add a check for an
out-of-memory condition.
- In function search_for_fuzz_match():
remove a call to strnsave() and thus avoid having to add a check for
an out-of-memory condition, also replace the call to STRLEN() by
ml_get_buf_len().
closes: #16689
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: 'listchars' "precedes" is not drawn on Tabs.
Solution: Only draw 'listchars' "precedes" when not skipping over cells.
(zeertzjq)
fixes: #5927closes: #16691
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: missing out-of-memory test in buf_write()
Solution: Check that the returned allocated buffer is not NULL
(John Marriott)
closes: #16678
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The new native commenting functionality is currently not used when
editing mail. One could reasonably expect it to change the "quote" state
of any given line in the mail (i.e. the preceding ">"), which would be
very handy and feel natural when editing mail. Especially since the
current file already uses "setlocal comments+=n:>".
Solution: Add commentstring to `> %s` to be used in files of type mail.
closes: #16669
Signed-off-by: Lucas Eekhof <105216949+eekhof@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: patch 9.1.1119 caused a regression with imports
(girishji)
Solution: revert the script ID change for the class script variable for
now (Yegappan Lakshmanan)
fixes: #16664closes: #16670
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: when 'completeopt' is set to preinsert the preinserted text is
not cleared when adding new leader (Yee Cheng Chin)
Solution: add a condition to delete preinsert text in edit function
(glepnir)
closes: #16672
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: patch 9.1.1121 used a wrong way to handle enter
Solution: compl_enter_selects also needs to consider the selected item
in ins_compl_new_leader() (glepnir)
closes: #16673
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cannot loop through pum menu with multiline items with
fuzzy and noselect in 'completeopt' (Tomasz N)
Solution: remove unnecessary compl_no_select condition (glepnir)
fixes: #16641closes: #16674
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: No test for 'listchars' "precedes" with double-width char.
Solution: Add a test and fix a typo in code (zeertzjq).
closes: #16675
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Highlight groups PopupSelected/PopupNotification/
MessageWindow are supposed to fall back to default highlight
groups if they are not defined. However, once a colorscheme
has defined them, switching to another colorscheme that
doesn't do so will leave behind a cleared colorscheme, which
causes the fallback to fail.
Solution: Set up default links to the relevant fallback highlight
groups, which makes sure a `:hi clear` command will reset the
state properly (Yee Cheng Chin).
closes: #16676
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/dosini.vim supports both ; and # as comments, and I think
a bunch of the files detected as dosini do too, so add support for # to
the ftplugin.
closes: #16681
Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: too many strlen() calls in findfile.c
Solution: refactor findfile.c and remove calls to strlen()
(John Marriott)
closes: #16595
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Enter does not insert newline with "noselect" when the pum is
visible (lifepillar)
Solution: When Enter is pressed and no complete-item is selected,
ins_compl_prep returns false, and the edit function continues
processing Enter to insert a new line. (glepnir)
fixes: #1653closes: #16653
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
If $MYVIMDIR is unset netrw creates a directory called '$MYVIMDIR' in
the current directory
fixes: #16609
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: Not able to use an autoloaded class from another
autoloaded script (Elliot)
Solution: make it work (Yegappan Lakshmanan)
fixes: #15031closes: #16652
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_termcodes fails
(after: v9.1.1114)
Solution: adjust the test for the expected termguicolors value
Signed-off-by: Christian Brabandt <cb@256bit.org>
Contain the vimNotation syntax group, matching this at top level is
unnecessary and very slow.
The removed vimString and vimNumber definitions are broken and/or never
match. They have long been replaced by newer definitions.
closes: #16645
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: there are a few minor style issues
Solution: fix the issues (Hirohito Higashi)
closes: #16646
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: super not supported in lambda expressions
(Aliaksei Budavei)
Solution: Support using the super keyword in a closure in an instance
method (Yegappan Lakshmanan)
fixes: #16586closes: #16647
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: [security]: use-after-free in str_to_reg()
(fizz-is-on-the-way)
Solution: when redirecting the :display command, check that one
does not output to the register being displayed
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-63p5-mwg2-787v
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: enabling termguicolors automatically confuses users. Since
querying the terminal for the RGB flag happens asynchronously,
enabling termguicolors is noticeable by users as the highlighting changes
and is therefore unexpected.
(after v9.1.1054)
Solution: comment out that part for now. We may need another way to
enable this in the future.
fixes: #16539fixes: #16568fixes: #16649
Signed-off-by: Christian Brabandt <cb@256bit.org>
The "Ukrainian enhanced keymap" allows you to type Ukrainian in Vim
using jcuken Windows layout.
Original file is made by Ivan Korneliuk and can be found at
https://github.com/vansha/ukrainian-enhanced.vim. It is being added here
with the permission of the author.
There is another ukrainian layout already in Vim, namely the
keymap\ukrainian-jcuken.vim script by Anatoli Sakhnik. But this one
differs in way it maps numeric keys. It uses values usual for Windows
users.
closes: #16628
Signed-off-by: Vladyslav Rehan <rehanvladyslav@gmail.com>
Signed-off-by: Ivan Korneliuk <vansha@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_terminal_builtin_without_gui waits 2 seconds
Solution: add --not-a-term to remove the annoying 2s delay in error
message when Vim detects that stdio are not from a terminal
(Yee Cheng Chin)
closes: #16635
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Inconsistencies in get_next_or_prev_match() (after 9.1.1109).
Solution: Change "file" to "entry" or "match" in comments. Use the same
order of branches for PAGEUP and PAGEDOWN (zeertzjq).
closes: #16633
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim tests are slow and flaky at the same time due to reliance
on timeouts which are unreliable.
Solution: improve Vim test performance and reduce flakiness
(Yee Cheng Chin)
A lot of Vim tests currently rely on waiting a specific amount of time
before asserting a condition. This is bad because 1) it is slow, as the
timeout is hardcoded, 2) it's unreliable as a resource-starved runner
may overshoot the timeout. Also, there are a lot of builtin sleep
commands in commonly used utilities like VerifyScreenDump and WaitFor()
which leads to a lot of unnecessary idle time.
Fix these issues by doing the following:
1. Make utilities like VerifyScreenDump and WaitFor use the lowest wait
time possible (1 ms). This essentially turns it into a spin wait. On
fast machines, these will finish very quickly. For existing tests
that had an implicit reliance on the old timeouts (e.g.
VerifyScreenDump had a 50ms wait before), fix the tests to wait that
specific amount explicitly.
2. Fix tests that sleep or wait for long amounts of time to instead
explicitly use a callback mechanism to be notified when a child
terminal job has finished. This allows the test to only take as much
time as possible instead of having to hard code an unreliable
timeout.
With these fixes, tests should 1) completely quickly on fast machines,
and 2) on slow machines they will still run to completion albeit slowly.
Note that previoulsy both were not true. The hardcoded timeouts meant
that on fast machines the tests were mostly idling wasting time, whereas
on slow machines, the timeouts often were not generous enough to allow
them to run to completion.
closes: #16615
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cmdexpand.c hard to read
Solution: refactor the file slightly (glepnir)
closes: #16621
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: 'smoothscroll' gets stuck with 'listchars' "eol".
Solution: Count size of 'listchars' "eol" in line size when scrolling.
(zeertzjq)
related: neovim/neovim#32405
closes: #16627
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cannot loop through completion menu with fuzzy and nosort in
'completeopt'
(Tomasz N)
Solution: Reset cur to zero and update compl_shown_match when
'completeopt' contains "nosort" but not "noselect"
(glepnir)
fixes: #16624closes: #16629
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Match Vim9 boolean and null literals in parenthesised expressions and
function argument lists.
- Match read-only registers in expressions.
closes: #16622
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_log_nonexistent() causes asan failure
(Hirohito Higashi)
Solution: don't run vim using system(), but run Vim in a terminal
related: #16602
related: #16610
Signed-off-by: Christian Brabandt <cb@256bit.org>