]> git.ipfire.org Git - thirdparty/vim.git/log
thirdparty/vim.git
21 months agoruntime(doc): clarify ':set[l] {option}<' behaviour
Matt Ellis [Sat, 24 Feb 2024 16:02:43 +0000 (17:02 +0100)] 
runtime(doc): clarify ':set[l] {option}<' behaviour

closes: #14062

Signed-off-by: Matt Ellis <m.t.ellis@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0135: Insufficient testing for 'delcombine' v9.1.0135
zeertzjq [Sat, 24 Feb 2024 15:51:32 +0000 (16:51 +0100)] 
patch 9.1.0135: Insufficient testing for 'delcombine'

Problem:  Insufficient testing for 'delcombine'.
Solution: Add test for both Normal and Insert modes without Arabic.
          (zeertzjq)

closes: #14086

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0134: CI: Test_term_gettitle() is flaky on MacOS 14 v9.1.0134
Christian Brabandt [Sat, 24 Feb 2024 14:56:34 +0000 (15:56 +0100)] 
patch 9.1.0134: CI: Test_term_gettitle() is flaky on MacOS 14

Problem:  Test_term_gettitle() is flaky on MacOS 14 and Github runners
Solution: Skip the test on Github CI

closes: #14085

It fails with this: '^\\[No Name\\] - VIM\\d*$' does not match 'e] - VIM'
It is not clear why term_gettitle() only get's the last part of the
expected title (perhaps there is a Carriage return in there or the
terminal window is too small?)

So let's just skip this test for now.

Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0133: MS-Windows: ligatures not rendering correctly v9.1.0133
Erik S. V. Jansson [Sat, 24 Feb 2024 13:26:52 +0000 (14:26 +0100)] 
patch 9.1.0133: MS-Windows: ligatures not rendering correctly

Problem:  font ligatures don't render correctly in the Win32 GUI-version
          of gvim even when set rop=type:directx is used. Setting
          guiligatures also doesn't make any difference. This leads to
          broken font ligatures when the cursor passes through them. It
          does not recover from this, and they remain broken until you
          re-render the whole buffer (e.g. by using Ctrl+L).

Solution: the problem is that we only re-draw the current and previous
          character in gui_undraw_cursor() and only have the special case
          for GTK when it comes to rendering ligatures. So let's enable
          gui_adjust_undraw_cursor_for_ligatures() to also happen for
          Win32 GUI if guiligatures is setup correctly (all this does is
          expand the range of gui_undraw_cursor() with ligature characters).

related: #9181
related: #12901
closes: #14084

Signed-off-by: Erik S. V. Jansson <caffeineviking@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0132: "C" doesn't include composing chars with 'virtualedit' v9.1.0132
zeertzjq [Sat, 24 Feb 2024 13:21:39 +0000 (14:21 +0100)] 
patch 9.1.0132: "C" doesn't include composing chars with 'virtualedit'

Problem:  using "C" and 've=all' set, doesn't include composing chars
          when changing a line, keeps the composing chars for whatever
          is typed afterwards.
Solution: Use mb_head_off() and mb_ptr2len() instead of mb_tail_off().
          (zeertzjq)

closes: #14083

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0131: buffer-completion may not always find all matches v9.1.0131
Christian Brabandt [Sat, 24 Feb 2024 13:12:13 +0000 (14:12 +0100)] 
patch 9.1.0131: buffer-completion may not always find all matches

Problem:  buffer-completion code too complicated and does not always
          find all matches (irisjae)
Solution: do not try to anchor pattern to beginning of line or
          directory-separator, always return all matches

Note: we are considering the non-fuzzy buffer-matching here.

Currently, the buffer-completion code makes 2 attempts to match a
pattern against the list of available patterns. First try is to match
the pattern and anchor it to either the beginning of the file name or
at a directory-separator (// or \\).

When a match is found, Vim returns the matching buffers and does not try
to find a match anywhere within a buffer name. So if you have opened two
buffers like /tmp/Foobar.c and /tmp/MyFoobar.c using `:b Foo` will only
complete to the first filename, but not the second (the same happens
with `getcompletion('Foo', 'buffer')`).

It may make sense, that completion priorities buffer names at directory
boundaries, but it inconsistent, may cause confusion why a certain
buffer name is not completed when typing `:b Foo<C-D>` which returns
only a single file name and then pressing Enter (to switch to that
buffer), Vim will error with 'E93: More than one match for Foo').
Similar things may happen when wiping the /tmp/Foobar.c pattern and
afterwards the completion starts completing other buffers.

So let's simplify the code and always match the pattern anywhere in the
buffer name, do not try to favor matches at directory boundaries. This
is also simplifies the code a bit, we do not need to run over the list
of buffers several times, but only twice.

fixes #13894
closes: #14082

Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0130: [security]: UAF if win_split_ins autocommands delete "wp" v9.1.0130
Sean Dewar [Sat, 24 Feb 2024 09:20:24 +0000 (10:20 +0100)] 
patch 9.1.0130: [security]: UAF if win_split_ins autocommands delete "wp"

Problem:  heap-use-after-free in win_splitmove if Enter/Leave
          autocommands from win_split_ins immediately closes "wp".
Solution: check that "wp" is valid after win_split_ins.
          (Sean Dewar)

closes: #14078

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0129: Fix truncation of text_wrap 'wrap' virt text after EOL list char v9.1.0129
Dylan Thacker-Smith [Sat, 24 Feb 2024 09:17:11 +0000 (10:17 +0100)] 
patch 9.1.0129: Fix truncation of text_wrap 'wrap' virt text after EOL list char

Problem:  Virtual text with text_wrap 'wrap' was effectively being
          truncated by a break conditional on the EOL list character
          being added to the screen line. (BigPeet)
Solution: Remove the condition that was leading to the early break and
          instead fix a similar but incorrectly written outer condition
          that checks if there is more to add at the end of the screen
          line. (Dylan Thacker-Smith)

Also, related:
- update comment in win_line()
- remove no longer necessary at_end_str variable in win_line()

fixes: #12725
closes: #14079

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agoruntime(doc) Update help text for matchbufline() and matchstrlist()
Yegappan Lakshmanan [Sat, 24 Feb 2024 09:09:43 +0000 (10:09 +0100)] 
runtime(doc) Update help text for matchbufline() and matchstrlist()

closes: #14080

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agoruntime(tutor): small fixes to the zh tutor (#14081)
dragonish [Sat, 24 Feb 2024 09:08:19 +0000 (17:08 +0800)] 
runtime(tutor): small fixes to the zh tutor (#14081)

dragonish <no.web.developer@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agoruntime(spec): Recognize SourceLicense tag name in RPM spec syntax (#14046)
Petr Pisar [Thu, 22 Feb 2024 19:39:09 +0000 (20:39 +0100)] 
runtime(spec): Recognize SourceLicense tag name in RPM spec syntax (#14046)

rpm-4.19.0 added a new SourceLicense tag. It is used at the same place
as License tag.

This patch adds the new tag name into a Vim syntax file to be
highligted the same way as the License tag. Note that it has to be
defined in the syntax file before Source\d* regexp. Otherwise it's not
recognized by Vim.

Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0128: win_gotoid() may abort even when not switching a window v9.1.0128
Sean Dewar [Thu, 22 Feb 2024 18:53:33 +0000 (19:53 +0100)] 
patch 9.1.0128: win_gotoid() may abort even when not switching a window

Problem:  win_gotoid() checks for textlock and other things when switching
          to a window that is already current (after v9.1.0119)
Solution: return early with success when attempting to switch to curwin
          (Sean Dewar)

Other potential causes of E565 from win_gotoid after v9.1.0119 should be
correct. Plugins can consider using win_execute() instead if they wish to
temporarily switch windows during textlock.

fixes: #14073
closes: #14074

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0127: Naming a non-pointer variable "oap" is strange v9.1.0127
zeertzjq [Thu, 22 Feb 2024 18:51:34 +0000 (19:51 +0100)] 
patch 9.1.0127: Naming a non-pointer variable "oap" is strange

Problem:  Naming a non-pointer variable "oap" is strange.
Solution: Rename it to "oa". Also prevent using freed memory in case of
          memory allocation failure. (zeertzjq)

closes: #14075

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agopatch 9.1.0126: Internal error when using upper-case mark in getregion() v9.1.0126
zeertzjq [Thu, 22 Feb 2024 18:48:06 +0000 (19:48 +0100)] 
patch 9.1.0126: Internal error when using upper-case mark in getregion()

Problem:  Internal error when passing mark in another buffer to
          getregion().
Solution: Don't allow marks in another buffer (zeertzjq)

closes: #14076

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Internal error when passing mark in another buffer to getregion()

21 months agoruntime(vim): Update base-syntax, fix :unabbrev highlighting (#14077)
dkearns [Thu, 22 Feb 2024 18:45:05 +0000 (05:45 +1100)] 
runtime(vim): Update base-syntax, fix :unabbrev highlighting (#14077)

Fixes issue #7876

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
21 months agoruntime(java): add syntax support for Java switch expressions (#9124)
Nick Hanley [Thu, 22 Feb 2024 14:06:19 +0000 (09:06 -0500)] 
runtime(java): add syntax support for Java switch expressions (#9124)

Signed-off-by: Nick Hanley <nicholasjhanley@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0125: unused init of text_prop_idxs in win_line() v9.1.0125
Dylan Thacker-Smith [Wed, 21 Feb 2024 20:03:10 +0000 (21:03 +0100)] 
patch 9.1.0125: unused init of text_prop_idxs in win_line()

Problem:  unused init of text_prop_idxs in win_line
Solution: Remove it, fix typo
          (Dylan Thacker-Smith)

Later use of text_prop_idxs treats it as empty, incrementing
text_props_active as new elements are added to this array, so remove
this unused conditional initialization when text_props_active is 0.

closes: #14063

Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0124: display of below/right virtual text with non-virtual text overlap v9.1.0124
Dylan Thacker-Smith [Wed, 21 Feb 2024 20:00:59 +0000 (21:00 +0100)] 
patch 9.1.0124: display of below/right virtual text with non-virtual text overlap

Problem:  Virtual text with text_align 'right'/'below' wasn't being
          used when a non-virtual text property overlaps with the end of
          the line. This was because the non-virtual text property had a
          higher priority, preventing the virtual text from being used.
Solution: Fix the sorting of text properties so virtual text properties
          have a higher priority than non-virtual text properties.
          (Dylan Thacker-Smith)

related: #14063

Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(doc): clarify expand() for :terminal windows
Christian Brabandt [Wed, 21 Feb 2024 19:40:05 +0000 (20:40 +0100)] 
runtime(doc): clarify expand() for :terminal windows

While adding to the documentation, also mention the rolled-back key-translation
strategy in version9.txt

closes: #14069

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0123: MS-Windows: system() may deadlock v9.1.0123
GuyBrush [Wed, 21 Feb 2024 19:16:38 +0000 (20:16 +0100)] 
patch 9.1.0123: MS-Windows: system() may deadlock

Problem:  MS-Windows: system() may deadlock when calling binaries that
          expect stdin
Solution: Ignore the SHELL_EXPAND flag
          (GuyBrush)

This happens on binaries that expect stdin. For example:

:echo system("xxd")

will cause a deadlock.

SHELL_EXPAND is a flag devoted to support the linux implementation of
the backtick-expansion mechanism.

On linux backtic-expansion relies in the function mch_expand_wildchars()
(os_unix.c) that delegates on each specific shell (bash, sh, csh, zsh)
the expansion. Basically it composes a shell command that does the
expansion and redirects the output to a file and call_shell() it. On
windows backtick-expansion is performed by Vim itself.

On linux SHELL_EXPAND modifies how mch_call_shell_fork() (os_unix.c)
works. This function:

- relies on posix fork() to spawn a child process to execute a
  external command.
- Child and parent process communicate using pipes (or pseudoterminal
  if available).
  User input (type ahead content) is processed in a loop only if
  !(SHELL_EXPAND || SHELL_COOKED).
  Though signals are used to detect Ctrl-C in all cases (the input
  loop is not necessary to interrupt the function).
  In the backtick-expansion the external command is the shell command
  that provides the expansion. For the child redirection:
  -  SHELL_EXPAND replaces stdin, stdout & stderr to /dev/null. This is
     why the shell command composed includes redirection (otherwise
     output would be lost).

  -  !SHELL_EXPAND replaces stdin, stdout & stderr with the parent
     created pipes (or pseudoterminal).
     Note that the use of SIGINT signal prevents mch_call_shell_fork()
     from hanging vim.

On Windows mch_system_piped() (os_win32.c) (which is only used when the
GUI is running) mimics mch_call_shell_fork() (os_unix.c).
Win32 lacks fork() and relies on CreateProcessW() and only has pipe
support (not pseudoterminal) which makes the implementation much
different.

But, the key idea is that windows lacks signals, the OS provides support
for console apps but gvim is not one. The only way of detecting a Ctrl-C
is actually processing user input (type ahead content). By ignoring the
user input under SHELL_EXPAND the function can hang gvim.

Ignoring SHELL_EXPAND flag has no consequence in Windows because as
mentioned above it is only meaningful in linux.

closes: #13988

Signed-off-by: GuyBrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0122: Some minor issues with the getregion() function v9.1.0122
Maxim Kim [Wed, 21 Feb 2024 18:48:37 +0000 (19:48 +0100)] 
patch 9.1.0122: Some minor issues with the getregion() function

Problem:  Some minor issues with the getregion() function
Solution: Fix examples in the help, use OP_NOP op_type and MBLOCK
          as motion_type in f_getreg(), update vim syntax to
          for getregion() (Maxim Kim)

```
:xnoremap <CR>
\ <Cmd>echow getregion('v', '.', mode())<CR>
```
`echo` while in visual mode has no visible effect, thus people trying
example might be frustrated as it looks like nothing happens.

So the option is to change it to `echow` or `echom`.
With `echom` it is again has no visible effect but one can at least inspect `:messages`.
On the other hand `echow` showes selected text in a popup window.

```
Can also be used as a |method|: >
'.'->getregion("'a', 'v')
```

Here is the typo, which makes example invalid, should be `("'a", ...`

closes: #14064

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(tmux): Update tmux syntax (#14065)
Eric Pruitt [Wed, 21 Feb 2024 18:46:47 +0000 (10:46 -0800)] 
runtime(tmux): Update tmux syntax (#14065)

Signed-off-by: Eric Pruitt <eric.pruitt@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0121: Infinite loop or signed overflow with 'smoothscroll' v9.1.0121
Sean Dewar [Wed, 21 Feb 2024 18:40:44 +0000 (19:40 +0100)] 
patch 9.1.0121: Infinite loop or signed overflow with 'smoothscroll'

Problem:  infinite loop in win_update with 'smoothscroll' set when
          window width is equal to textoff, or signed integer overflow
          if smaller.
Solution: don't revalidate wp->w_skipcol in that case, as no buffer text
          is being shown. (Sean Dewar)

Don't instead reset w_skipcol; that would lose the scroll position
within the line, which may be undesirable if the window is made wider
later.

Also include changes from the splitmove PR #14042 that I (in my infinite
Git wisdom) forgot to commit. This includes a change to
Test_window_split_no_room to ensure it doesn't fail for some screen
sizes.

Move Test_smoothscroll_in_zero_width_window to test_scroll_opt.vim, as
that file feels more appropriate.

closes: #14068

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0120: hard to get visual region using Vim script v9.1.0120
Shougo Matsushita [Tue, 20 Feb 2024 23:02:45 +0000 (00:02 +0100)] 
patch 9.1.0120: hard to get visual region using Vim script

Problem:  hard to get visual region using Vim script
Solution: Add getregion() Vim script function
          (Shougo Matsushita, Jakub Łuczyński)

closes: #13998
closes: #11579

Co-authored-by: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= <doubleloop@o2.pl>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0119: can move away from cmdwin using win_splitmove() v9.1.0119
Sean Dewar [Tue, 20 Feb 2024 21:05:10 +0000 (22:05 +0100)] 
patch 9.1.0119: can move away from cmdwin using win_splitmove()

Problem:  can switch windows while textlocked via f_win_gotoid and
          f_win_splitmove (which also allows switching in the cmdwin).
Solution: Check text_or_buf_locked in f_win_splitmove()
          (Sean Dewar)

While at it, call text_or_buf_locked() in f_win_gotoid() instead of
testing for cmdwin_type() (which text_buf_locked() does and
in addition will also verify that the buffer is not locked).

closes: #14042

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0118: Use different restoration strategy in win_splitmove v9.1.0118
Sean Dewar [Tue, 20 Feb 2024 21:00:33 +0000 (22:00 +0100)] 
patch 9.1.0118: Use different restoration strategy in win_splitmove

Problem:  saving and restoring all frames to split-move is overkill now
          that WinNewPre is not fired when split-moving.
Solution: defer the flattening of frames until win_split_ins begins
          reorganising them, and attempt to restore the layout by
          undoing our changes. (Sean Dewar)

This also means we no longer must allocate.

related: #14042

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommands v9.1.0117
Sean Dewar [Tue, 20 Feb 2024 20:52:31 +0000 (21:52 +0100)] 
patch 9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommands

Problem:  win_splitmove fires WinNewPre and possibly WinNew when moving
          windows, even though no new windows are created.
Solution: don't fire WinNew and WinNewPre when inserting an existing
          window, even if it isn't the current window. Improve the
          accuracy of related documentation. (Sean Dewar)

Likewise, before this patch, WinClosed was not fired anyway (even for :wincmd
H/J/K/L, which also didn't fire WinNew, but did still fire WinNewPre), despite
documentation saying windows are "closed". Note that :wincmd T actually indeed
works by creating a new window (and closing the old one), unlike the others.

This also fixes issues where WinNewPre is fired when split-moving while curwin
doesn't yet have a frame or entry in the window list, causing many things to not
work (it's not considered valid at that point). This was guaranteed when using
:wincmd H/J/K/L.

Because WinNewPre is no longer fired when split-moving, this makes restoring the
previous window layout on failure easier, as we can be sure that frames are not
resized from WinNewPre autocommands if win_split_ins fails. This allows us to
use a different strategy in the following commit.

--

In my opinion, this leaves questions about the current usefulness of WinNewPre.
A motivation described in #10635 states how creating a new window can steal room
from other windows, and how WinNewPre will be useful for detecting that, but
this is also true when inserting an existing window, which now doesn't fire it.
Maybe the autocommand should be changed to have a better name?

There are also other issues I found with the current implementation of WinNewPre
that need addressing:

- it allows switching windows and tabpages, which can cause incorrect windows to
  be split/moved, and big problems when switching tabpages.

- it fires before win_split_ins checks for room, before it makes any changes to
  window sizes or before it considers allocating a new window. This should be
  changed or documented.

I hope to address some of this stuff in a different PR, if possible.

related: #14038

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0116: win_split_ins may not check available room v9.1.0116
Sean Dewar [Tue, 20 Feb 2024 19:28:15 +0000 (20:28 +0100)] 
patch 9.1.0116: win_split_ins may not check available room

Problem:  win_split_ins has no check for E36 when moving an existing
          window
Solution: check for room and fix the issues in f_win_splitmove()
          (Sean Dewar)

win_split_ins has no check for E36 when moving an existing window,
allowing for layouts with many overlapping zero-sized windows to be
created (which may also cause drawing issues with tablines and such).
f_win_splitmove also has some bugs.

So check for room and fix the issues in f_win_splitmove. Handle failure
in the two relevant win_split_ins callers by restoring the original
layout, and factor the common logic into win_splitmove.

Don't check for room when opening an autocommand window, as it's a
temporary window that's rarely interacted with or drawn anyhow, and is
rather important for some autocommands.

Issues fixed in f_win_splitmove:
- Error if splitting is disallowed.
- Fix heap-use-after-frees if autocommands fired from switching to "targetwin"
  close "wp" or "oldwin".
- Fix splitting the wrong window if autocommands fired from switching to
  "targetwin" switch to a different window.
- Ensure -1 is returned for all errors.

Also handle allocation failure a bit earlier in make_snapshot (callers,
except win_splitmove, don't really care if a snapshot can't be made, so
just ignore the return value).

Note: Test_smoothscroll_in_zero_width_window failed after these changes with
E36, as it was using the previous behaviour to create a zero-width window.
I've fixed the test such that it fails with UBSAN as expected when v9.0.1367 is
reverted (and simplified it too).

related: #14042

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(doc): Add a place holder section for version 9.2 (#14060)
Yegappan Lakshmanan [Tue, 20 Feb 2024 18:48:22 +0000 (10:48 -0800)] 
runtime(doc): Add a place holder section for version 9.2 (#14060)

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(filetype): Modula-2 files with priority not detected (#14055)
dkearns [Mon, 19 Feb 2024 19:58:30 +0000 (06:58 +1100)] 
runtime(filetype): Modula-2 files with priority not detected (#14055)

Problem:  Modula-2 files with a specified priority are not detected.
Solution: Match the priority syntax in module header lines when
          performing heuristic content detection.

Disable the :defcompile debug line.  This was accidentally left enabled
in commit 68a8947.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoCI: install gnudiff and enable `Test_diffmode` on macos-14 runner again (#14056)
Linda_pp [Mon, 19 Feb 2024 19:55:55 +0000 (04:55 +0900)] 
CI: install gnudiff and enable `Test_diffmode` on macos-14 runner again (#14056)

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(misc): announce adoption of various runtime files
Christian Brabandt [Mon, 19 Feb 2024 19:37:11 +0000 (20:37 +0100)] 
runtime(misc): announce adoption of various runtime files

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(vim): Distinguish Vim9 constructor definitions from the :new ex command ...
Aliaksei Budavei [Sun, 18 Feb 2024 18:02:14 +0000 (21:02 +0300)] 
runtime(vim): Distinguish Vim9 constructor definitions from the :new ex command (#14050)

With the arrival of Vim9 classes, the syntax must allow for
_new_ constructors; multiple constructor definitions are
supported for a class, provided distinct suffix-names are
used.  Currently, the defined constructors match either
vimCommand or vimFunctionError (for any newBar).

For example:
------------------------------------------------------------
vim9script

class Foo
    def new()
    enddef

    def newBar()
    enddef
endclass
------------------------------------------------------------

Since every constructor is required to bear a lower-cased
_new_ prefix name, it should suffice to distinguish them
from functions, and so there are no new highlight or syntax
groups introduced.

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0115: Using freed memory with full tag stack and user data v9.1.0115
zeertzjq [Sun, 18 Feb 2024 17:53:08 +0000 (18:53 +0100)] 
patch 9.1.0115: Using freed memory with full tag stack and user data

Problem:  Using freed memory with full tag stack and user data
          (Konstantin Khlebnikov)
Solution: Clear the user data pointer of the newest entry.
          (zeertzjq, Konstantin Khlebnikov)

fixes: neovim/neovim#27498
closes: #14053

Co-authored-by: Konstantin Khlebnikov koct9i@gmail.com
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Konstantin Khlebnikov koct9i@gmail.com
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(doc): Fix typo in testing.txt (#14054)
h_east [Sun, 18 Feb 2024 17:51:46 +0000 (02:51 +0900)] 
runtime(doc): Fix typo in testing.txt (#14054)

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0114: Setting some options may change curswant v9.1.0114
zeertzjq [Sun, 18 Feb 2024 08:33:54 +0000 (09:33 +0100)] 
patch 9.1.0114: Setting some options may change curswant

Problem:  Setting some options changes curswant unnecessarily.
Solution: Add a P_HLONLY flag that prevents changing curswant.
          (zeertzjq)

closes: #14044

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(less): update "Last Change:" header
Christian Brabandt [Thu, 15 Feb 2024 21:14:01 +0000 (22:14 +0100)] 
runtime(less): update "Last Change:" header

Commit 103f1dfb7df350650a5d7caadb0364bd79e9d25b forgot to update the
"Last Change:" header. So update it now.

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(less): reset readonly setting when disabling less mode
Christian Brabandt [Thu, 15 Feb 2024 20:44:05 +0000 (21:44 +0100)] 
runtime(less): reset readonly setting when disabling less mode

While at it, also do the unmap only if a specific key has been mapped.
There are some keys that are only selectively mapped and it would cause
an error if we are trying to unmap such a key (e.g. z when your
foldmethod is not manual).

fixes: #14040

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0113: duplicate code when cleaning undo stack v9.1.0113
Christian Brabandt [Thu, 15 Feb 2024 19:17:37 +0000 (20:17 +0100)] 
patch 9.1.0113: duplicate code when cleaning undo stack

Problem:  duplicate code when cleaning undo stack
Solution: refactor undo cleanup into a single public function

related: #13928

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0112: Remove undo information, when cleaning quickfix buffer v9.1.0112
Christian Brabandt [Thu, 15 Feb 2024 19:15:04 +0000 (20:15 +0100)] 
patch 9.1.0112: Remove undo information, when cleaning quickfix buffer

Problem:  When the quickfix buffer has been modified an autocommand
          may invalidate the undo stack (kawarimidoll)
Solution: When clearing the quickfix buffer, also wipe the undo stack

fixes: #13905
closes: #13928

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0111: filetype: no support for bats files v9.1.0111
Brandon Maier [Wed, 14 Feb 2024 23:16:02 +0000 (00:16 +0100)] 
patch 9.1.0111: filetype: no support for bats files

The '*.bats' file type is for Bash Automated Testing System (BATS)
scripts. BATS scripts are Bash with a special '@test' extension but they
otherwise work with Vim's bash filetype.

See https://github.com/bats-core/bats-core

closes: #14039

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0110: filetype: add 'Config.in' filetype detection v9.1.0110
Brandon Maier [Wed, 14 Feb 2024 21:30:06 +0000 (22:30 +0100)] 
patch 9.1.0110: filetype: add 'Config.in' filetype detection

The 'Config.in' file type is for Buildroot configuration files.
Buildroot Config.in files use the same Kconfig backend as the Linux
kernel's Kconfig files.

Buildroot also has other filename variants that follow "Config.in.*",
they are used to distinguish multiple Config.in files in the same
directory.

See https://buildroot.org/downloads/manual/manual.html#_literal_config_in_literal_file

closes: #14038

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(asciidoc): include basic ftplugin
Luca Saccarola [Wed, 14 Feb 2024 21:25:41 +0000 (22:25 +0100)] 
runtime(asciidoc): include basic ftplugin

closes: #13873

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0109: filetype: no support for its files v9.1.0109
Brandon Maier [Wed, 14 Feb 2024 20:31:47 +0000 (21:31 +0100)] 
patch 9.1.0109: filetype: no support for its files

Problem:  filetype: no support for its files
Solution: Add detection for *.its files as dts file type
          (Brandon Maier)

The '*.its' file type is for U-Boot Flattened Image Trees (FIT) which
use the flattened devicetree format.

See https://github.com/u-boot/u-boot/blob/master/doc/usage/fit/source_file_format.rst#terminology

closes: #14037

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(vim): Update base-syntax, remove unused vimString region
Doug Kearns [Wed, 14 Feb 2024 20:28:44 +0000 (21:28 +0100)] 
runtime(vim): Update base-syntax, remove unused vimString region

These were included with the initial release of the syntax file for Vim
5 and were probably intended to allow for syn-region start/skip/end
patterns with a '!' or '+' delimiter.  However, these cases are
currently handled by the vimSynRegPat group.

The removed patterns never match anywhere in the distributed runtime
files and it is believed that this is generally true.

closes: #14035

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(vim): Update base-syntax, fix :behave highlighting
Doug Kearns [Wed, 14 Feb 2024 20:17:43 +0000 (21:17 +0100)] 
runtime(vim): Update base-syntax, fix :behave highlighting

closes: #14036

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(vim): update Vim Syntax generator
h-east [Wed, 14 Feb 2024 20:00:01 +0000 (21:00 +0100)] 
runtime(vim): update Vim Syntax generator

- Add missing "Last Change:" line.
- The date on this line in vim.vim is updated by update_date.vim at
  Make time. (I made a mistake in the file path)
- Remove unnecessary "b:loaded_syntax_vim_ex".
- Remove "Base File Date:" line in vim.vim.base
- Add Doug Kearns as Maintainer

closes: #14031

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0108: filetype: no support for dtso files v9.1.0108
Markus Schneider-Pargmann [Wed, 14 Feb 2024 19:44:28 +0000 (20:44 +0100)] 
patch 9.1.0108: filetype: no support for dtso files

Problem:  filetype: no support for dtso files
Solution: Add detection for *.dtso files as dts file type
          (Markus Schneider-Pargmann)

*.dtso files are devicetree overlay files which have the same syntax as dts or dtsi files.

closes: #14026

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0107: CI: Fix MacOS-14 tests v9.1.0107
Yee Cheng Chin [Wed, 14 Feb 2024 19:34:58 +0000 (20:34 +0100)] 
patch 9.1.0107: CI: Fix MacOS-14 tests

Problem:  CI: Fix MacOS-14 tests (after 9.1.0070)
Solution: Re-enable sound tests by granting Mic access,
          disable Test_diff_screen because of buggy MacOS diff
          (non GNU version), re-enable Test_term_gettitle()
          (Yee Cheng Chin)

macos-14 runner was turned on in #13943, but it had to turn off a few
tests in order for CI to run. Re-enable them and fix the underlying
issues.

* `Test_diff_screen`: The test failure is due to a bug in Apple's diff
  utility. Apple introduced a new diff tool based on FreeBSD in macOS 13
  and it has buggy behaviors when using unified diff (`-U0`) and the
  diff is on the first line of the file. Simply disable this test for
  now if we detect Apple diff (instead of the old GNU diff). Can
  re-enable this in the future if Apple fixes the issue.
* `Test_play_event` / `Test_play_silent`: GitHub Actions currently has
  an issue with playing sound in CI in macos-14 runners. It for some
  reason triggers a microphone permission dialog popup which blocks the
  CI action (see https://github.com/actions/runner-images/issues/9330).
  To fix this, add a temporary step in macos-14 to manually allow
  microphone permissions in the runner.
* `Test_term_gettitle`: I could not reproduce the failure, so I just
  turned it on and it seems to run just fine. Maybe it's a timing issue
  and whatnot but either way that should be fixed when we can reproduce
  the issue.

closes: #14032

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0106: Visual highlight hard to read with 'termguicolors' v9.1.0106
Maxim Kim [Wed, 14 Feb 2024 19:28:17 +0000 (20:28 +0100)] 
patch 9.1.0106: Visual highlight hard to read with 'termguicolors'

Problem:  Visual highlight hard to read with 'termguicolors'
          (Maxim Kim)
Solution: Set Visual GUI foreground to black (with background=light)
          and lightgrey (with background=dark)
          (Maxim Kim)

fixes: #14024
closes: #14025

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(vim): include Vim Syntax generator
h-east [Tue, 13 Feb 2024 20:09:22 +0000 (21:09 +0100)] 
runtime(vim): include Vim Syntax generator

fixes: #13939
closes: #14021
related: vim-jp/syntax-vim-ex#28

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0105: Style: typos found v9.1.0105
zeertzjq [Tue, 13 Feb 2024 19:32:04 +0000 (20:32 +0100)] 
patch 9.1.0105: Style: typos found

Problem:  Style: typos found
Solution: correct them
          (zeertzjq)

closes: #14023

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0104: Linking fails with -lto because of PERL_CFLAGS 14022/head v9.1.0104
Christian Brabandt [Mon, 12 Feb 2024 22:12:26 +0000 (23:12 +0100)] 
patch 9.1.0104: Linking fails with -lto because of PERL_CFLAGS

Problem:  Linking fails with -lto because of PERL_CFLAGS
          (Zoltan Toth)
Solution: Filter out -flto argument from Perl CFLAGS.

fixes: #14012

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0103: 'breakindentopt' "min" not correct with 'signcolumn' v9.1.0103
zeertzjq [Mon, 12 Feb 2024 21:53:20 +0000 (22:53 +0100)] 
patch 9.1.0103: 'breakindentopt' "min" not correct with 'signcolumn'

Problem:  'breakindentopt' "min" works incorrectly with 'signcolumn'.
Solution: Use win_col_off() and win_col_off2().
          (zeertzjq)

closes: #14014

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0102: settabvar() may change the last accessed tabpage v9.1.0102
zeertzjq [Mon, 12 Feb 2024 21:50:26 +0000 (22:50 +0100)] 
patch 9.1.0102: settabvar() may change the last accessed tabpage

Problem:  settabvar() may change the last accessed tabpage.
Solution: Save and restore lastused_tabpage.
          (zeertzjq)

closes: #14017

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0101: upper-case of German sharp s should be U+1E9E v9.1.0101
glepnir [Mon, 12 Feb 2024 21:14:53 +0000 (22:14 +0100)] 
patch 9.1.0101: upper-case of German sharp s should be U+1E9E

Problem:  upper-case of ß should be U+1E9E (CAPITAL LETTER SHARP S)
          (fenuks)
Solution: Make gU, ~ and g~ convert the U+00DF LATIN SMALL LETTER SHARP S (ß)
          to U+1E9E LATIN CAPITAL LETTER SHARP S (ẞ), update tests
          (glepnir)

This is part of Unicode 5.1.0 from April 2008, so should be fairly safe
to use now and since 2017 is part of the German standard orthography,
according to Wikipedia:
https://en.wikipedia.org/wiki/Capital_%E1%BA%9E#cite_note-auto-12

There is however one exception: UnicodeData.txt for U+00DF
LATIN SMALL LETTER SHARP S does NOT define U+1E9E LATIN CAPITAL LETTER
SHARP S as its upper case version. Therefore, toupper() won't be able
to convert from lower sharp s to upper case sharp s (the other way
around however works, since U+00DF is considered the lower case
character of U+1E9E and therefore tolower() works correctly for the
upper case version).

fixes: #5573
closes: #14018

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0100: Redrawing can be improved with undo and 'spell' v9.1.0100
zeertzjq [Mon, 12 Feb 2024 19:28:01 +0000 (20:28 +0100)] 
patch 9.1.0100: Redrawing can be improved with undo and 'spell'

Problem:  When undoing with 'spell', redrawWinline() is called after
          changed_lines(), while later win_update() sets redraw type to
          UPD_NOT_VALID, even though w_redraw_top and w_redraw_bot are
          still valid.
Solution: Only set redraw type to UPD_NOT_VALID when inserting/deleting
          lines after parts of window has pending redraw, i.e., when
          changed_lines() is called after redrawWinline().
          (zeertzjq)

closes: #14019

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0099: Not able to use diff() with 'diffexpr' v9.1.0099
Yegappan Lakshmanan [Mon, 12 Feb 2024 19:21:26 +0000 (20:21 +0100)] 
patch 9.1.0099: Not able to use diff() with 'diffexpr'

Problem:  Not able to use diff() with 'diffexpr'
          (rickhowe, after v9.1.0096)
Solution: Use a default context length of 0, update diff() help text,
          add a test for using diff() with 'diffexpr'
          (Yegappan Lakshmanan)

closes: #14013

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(gpg): Mark dangerous use-embedded-filename with WarningMsg
Christian Brabandt [Sun, 11 Feb 2024 17:19:45 +0000 (18:19 +0100)] 
runtime(gpg): Mark dangerous use-embedded-filename with WarningMsg

The syntax highlighter is likely to encourage people to use the listed
commands.

But `use-embedded-filename` is a dangerous option that can cause GnuPG
to write arbitrary data to arbitrary files whenever GnuPG encounters
malicious data.

GnuPG upstream explicitly warns against using this option:

https://dev.gnupg.org/T4500
https://dev.gnupg.org/T6972

However, since this is a valid option, we cannot just drop it from the
syntax script. Instead, let's mark it with the WarningMsg highlighting
to make it obvious, that this option is different (and should not be
used for security reasons).

closes: #13961

Co-authored-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0098: CompletionChanged not triggered when new leader added without matches v9.1.0098
glepnir [Sun, 11 Feb 2024 16:52:40 +0000 (17:52 +0100)] 
patch 9.1.0098: CompletionChanged not triggered when new leader added without matches

Problem:  CompletionChanged not triggered when new leader added causing
          no matching item in the completion menu
Solution: When completion is active but no items matched still trigger
          CompletChanged event
          (glepnir)

closes: #13982

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0097: 'breakindent' behaves inconsistently with 'list' and splits v9.1.0097
zeertzjq [Sun, 11 Feb 2024 16:16:19 +0000 (17:16 +0100)] 
patch 9.1.0097: 'breakindent' behaves inconsistently with 'list' and splits

Problem:  'breakindent' behaves inconsistently with 'list' and splits.
Solution: Use 'listchars' from the correct window and handle caching
          properly. Move cheaper comparisons to the top.
          (zeertzjq)

closes: #14008

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(vim): Update syntax file (#14009)
dkearns [Sun, 11 Feb 2024 16:13:34 +0000 (03:13 +1100)] 
runtime(vim): Update syntax file (#14009)

- allow comments after :highight commands
- match the bang in a :highlight[!] command
- highlight the bang in :map[!], :menu[!] and :unlet[!] with vimOper
  like all other commands

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0096: diff() function uses 'diffexpr' v9.1.0096
Yegappan Lakshmanan [Sun, 11 Feb 2024 16:08:29 +0000 (17:08 +0100)] 
patch 9.1.0096: diff() function uses 'diffexpr'

Problem:  diff() function uses 'diffexpr'
          (rickhowe)
Solution: Make diff() always use internal diff(), add support for
          unified diff context length, sort diff() options in help
          (Yegappan Lakshmanan)

fixes: #13989
closes: #14010

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0095: tests: test_restricted() fails v9.1.0095
Christian Brabandt [Sat, 10 Feb 2024 12:50:54 +0000 (13:50 +0100)] 
patch 9.1.0095: tests: test_restricted() fails

Problem:  tests: test_restricted() fails
          (after: v9.1.0091)
Solution: Add a space before the pipecmd and the actual Vim command to
          run

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0094: xxd: buffer-overflow when writing color output v9.1.0094
Goffredo Baroncelli [Sat, 10 Feb 2024 12:31:06 +0000 (13:31 +0100)] 
patch 9.1.0094: xxd: buffer-overflow when writing color output

Problem:  xxd: buffer-overflow when writing color output
Solution: properly account for the color escape sequences and
          adjust LLEN macro
          (Goffredo Baroncelli)

xxd: crash with higer number of column

xxd writes the data into a buffer before printing. Unfortunately
the buffer doesn't consider the space consumed by the escape
sequences used to change the color of the character.

BEFORE:
$ xxd -Ralways -c 256 /etc/passwd
Segmentation fault (core dumped)

AFTER:
$ ./xxd -Ralways -c 256 /etc/passwd
00000000: 726f 6f74 3a78 3a30 3a30 3a72 6f6f 743a 2f72 [...]

To solve this issue I had to increase the size of the buffer
considering for each byte of data 11 further characters for the
color escape sequence.

closes: #14003

Signed-off-by: Goffredo Baroncelli <kreijack@libero.it>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0093: Still a qsort() comparison function that returns result of subtraction v9.1.0093
zeertzjq [Sat, 10 Feb 2024 12:24:03 +0000 (13:24 +0100)] 
patch 9.1.0093: Still a qsort() comparison function that returns result of subtraction

Problem:  Still a qsort() comparison function fuzzy_match_item_compare()
          that returns result of subtraction (after 9.1.0089).
Solution: Use an explicit comparison instead of subtraction.
          (zeertzjq)

closes: #14004

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0092: Compiler warning for missing type in scroll_event() v9.1.0092
Christian Brabandt [Sat, 10 Feb 2024 12:17:16 +0000 (13:17 +0100)] 
patch 9.1.0092: Compiler warning for missing type in scroll_event()

Problem:  Compiler warning for missing type in scroll_event()
          (chdiza)
Solution: Declare display_type explicitly as integer

fixes: #14005

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0091: Syntax test fails when run with non C locale v9.1.0091
Christian Brabandt [Sat, 10 Feb 2024 12:02:17 +0000 (13:02 +0100)] 
patch 9.1.0091: Syntax test fails when run with non C locale

Problem:  Syntax test fails when run with non C locale
Solution: Run syntax tests with C locale, clean up Xtestscript file,
          strip environment variables from GetVimCommand()
          (h-east)

closes: #14007

Co-authored-by: h-east <h.east.727@gmail.com>
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0090: Assigning wrong colors when parsing terminal OSC response v9.1.0090
Maxim Kim [Fri, 9 Feb 2024 22:11:54 +0000 (23:11 +0100)] 
patch 9.1.0090: Assigning wrong colors when parsing terminal OSC response

Problem:  Assigning wrong colors when parsing terminal OSC response
Solution: Correctly assign Green and Blue from the terminal response
          (Maxim Kim)

closes: #13981

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(vim): Fix indent after line with literal dict
Andrew Radev [Fri, 9 Feb 2024 18:44:28 +0000 (19:44 +0100)] 
runtime(vim): Fix indent after line with literal dict

closes: #13966

Signed-off-by: Andrew Radev <andrey.radev@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0089: qsort() comparison functions should be transitive v9.1.0089
Christian Brabandt [Fri, 9 Feb 2024 18:39:14 +0000 (19:39 +0100)] 
patch 9.1.0089: qsort() comparison functions should be transitive

Problem:  qsort() comparison functions should be transitive
Solution: Do not subtract values, but rather use explicit comparisons

Improve qsort() comparison functions

There has been a recent report on qsort() causing out-of-bounds read &
write in glibc for non transitive comparison functions
https://www.qualys.com/2024/01/30/qsort.txt

Even so the bug is in glibc's implementation of the qsort() algorithm,
it's bad style to just use substraction for the comparison functions,
which may cause overflow issues and as hinted at in OpenBSD's manual
page for qsort(): "It is almost always an error to use subtraction to
compute the return value of the comparison function."

So check the qsort() comparison functions and change them to be safe.

closes: #13980

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0088: TextChanged not triggered for :norm! commands v9.1.0088
Christian Brabandt [Fri, 9 Feb 2024 18:34:36 +0000 (19:34 +0100)] 
patch 9.1.0088: TextChanged not triggered for :norm! commands

Problem:  TextChanged not triggered for :norm! commands
          (machakann, after v9.0.2031)
Solution: Only reset curbuf->b_last_changedtick if TextChangedI
          was triggered in insert mode (and not blocked)

Note: for unknown reasons, the test fails on Windows (but seems to work
fine when running interactively)

fixes: #13967
closes: #13984

Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0087: Restoring lastused_tabpage too early in do_arg_all() v9.1.0087
glepnir [Fri, 9 Feb 2024 18:30:26 +0000 (19:30 +0100)] 
patch 9.1.0087: Restoring lastused_tabpage too early in do_arg_all()

Problem:  Restore lastused_tabpage too early in do_arg_all() function it
          will change later in the function.
Solution: Restore lastused_tabpage a bit later, when being done with
          tabpages (glepnir)

closes: #13992

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0086: Problem when scrolling using slow touchpads scroll event v9.1.0086
lilydjwg [Fri, 9 Feb 2024 18:24:23 +0000 (19:24 +0100)] 
patch 9.1.0086: Problem when scrolling using slow touchpads scroll event

Problem:  Problem when scrolling using slow touchpads scroll event
Solution: better ways to determine if a smooth scroll has ended (when
          available) (lilydjwg)

related: #13997

Signed-off-by: lilydjwg <lilydjwg@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0085: X11 scroll size changes after accessing clipboard v9.1.0085
lilydjwg [Fri, 9 Feb 2024 18:13:12 +0000 (19:13 +0100)] 
patch 9.1.0085: X11 scroll size changes after accessing clipboard

Problem:  X11 scroll size changes after accessing clipboard
          (Ernie Rael)
Solution: use GDK_SCROLL_MASK for X11 and GDK_SMOOTH_SCROLL_MASK for
          Wayland (lilydjwg)

because GDK_SCROLL_SMOOTH events don't work well for x11 (see comments).

fixes #13994
closes: #13997

Signed-off-by: lilydjwg <lilydjwg@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoCI: Add Codecov token (#13999)
K.Takata [Fri, 9 Feb 2024 17:18:11 +0000 (02:18 +0900)] 
CI: Add Codecov token (#13999)

codecov-action@4 requires a token.
Add it to the repository secrets.

See: https://github.com/vim/vim/pull/13978#issuecomment-1935336624

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak' v9.1.0084
zeertzjq [Fri, 9 Feb 2024 17:14:12 +0000 (18:14 +0100)] 
patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'

Problem:  Visual hl wrong when it ends before multibyte 'showbreak'.
          (lacygoil)
Solution: Use vcol_sbr instead of adding n_extra.
          (zeertzjq)

fixes: #11272
closes: #13996

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0083: Redrawing can be improved when deleting lines with 'number' v9.1.0083
zeertzjq [Thu, 8 Feb 2024 10:37:40 +0000 (11:37 +0100)] 
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'

Problem:  Redrawing can be improved when inserting/deleting lines with 'number'.
Solution: Only redraw the number column of lines below changed lines.
          Add a test as this wasn't previously tested.
          (zeertzjq)

closes: #13985

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0082: Redrawing can be improved when deleting lines with 'cursorline' v9.1.0082
zeertzjq [Thu, 8 Feb 2024 10:34:55 +0000 (11:34 +0100)] 
patch 9.1.0082: Redrawing can be improved when deleting lines with 'cursorline'

Problem:  Redrawing can be improved when deleting lines with 'cursorline'.
Solution: Use smarter invalidation and adjustment.  Remove unnecessary
          UPD_VALID as it is already set at the top of the loop.  Make
          the test for #4862 fail without the fix.
          (zeertzjq)

closes: #13986

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(doc): further improve docs about List/Blob += operator
zeertzjq [Thu, 8 Feb 2024 10:21:44 +0000 (11:21 +0100)] 
runtime(doc): further improve docs about List/Blob += operator

closes: #13990

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0081: X11 mouse-scrolling stutters v9.1.0081
lilydjwg [Thu, 8 Feb 2024 10:04:21 +0000 (11:04 +0100)] 
patch 9.1.0081: X11 mouse-scrolling stutters

Problem:  X11 mouse-scrolling stutters
          (Ron Aaron, after 9.1.0064)
Solution: Handle GDK_SCROLL_SMOOTH fractional distance events
          (lilydjwg)

I don't know why, but with GDK_SMOOTH_SCROLL_MASK we get wheel events as
GDK_SCROLL_SMOOTH. What's more, one wheel scroll is counted as 1.5
distance in Wayland but 1.0 in X11.

I failed to find any docs on gtk.org about this.

fixes: #13987
closes: #13991

Signed-off-by: lilydjwg <lilydjwg@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(doc): Clarify list-concatenation a bit more
qeatzy [Wed, 7 Feb 2024 16:52:25 +0000 (17:52 +0100)] 
runtime(doc): Clarify list-concatenation a bit more

Make doc list-concatenation more clear as for += and extend().

1. describe `+=` for list-concatenation more accurately
2. add `extend()` example for list-concatenation
3. Fix CI errors for missing helptags reference |+=|

closes: #13983

Signed-off-by: qeatzy <qeatzy@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0080: unexpected error for modifying final list using += v9.1.0080
Yegappan Lakshmanan [Tue, 6 Feb 2024 10:03:36 +0000 (11:03 +0100)] 
patch 9.1.0080: unexpected error for modifying final list using +=

Problem:  unexpected error for modifying final list using += operator
          (Ernie Rael)
Solution: Allow List value modification of a final variable using +=
          operator
          (Yegappan Lakshmanan)

fixes: #13745
fixes: #13959
closes: #13962

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines v9.1.0079
zeertzjq [Tue, 6 Feb 2024 09:59:03 +0000 (10:59 +0100)] 
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines

Problem:  LineNrAbove and LineNrBelow background wrong on wrapped lines.
Solution: Update number column also for wrapped part of a line.
          (zeertzjq)

closes: #13974

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(dosbatch): improve '::' comment highlighting
Christian Brabandt [Tue, 6 Feb 2024 09:56:26 +0000 (10:56 +0100)] 
runtime(dosbatch): improve '::' comment highlighting

Added a syntax region for command blocks so that the highlighting of
`::` comments in them can be controlled.  The `dosbatch_colons_comment`
variable now controls if all `::` comments in a code block are
highlighted as comments or errors.  A `::` comment at the end of a
command block is always highlighted as an error.

This re-enables the highlighting of `::` comments in `.bat` files as
requested in #13666, while allowing control of highlighting them in
command blocks requested in #11778 and first attempted in #11980.

related: #11980
fixes: #13666

Co-authored-by: Mike Williams <mikew@globalgraphics.com>
Signed-off-by: Mike Williams <mikew@globalgraphics.com>
Signed-off-by: mevanlc <mevanlc@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0078: GTK3: using wrong style for pre-edit area v9.1.0078
lilydjwg [Tue, 6 Feb 2024 09:49:14 +0000 (10:49 +0100)] 
patch 9.1.0078: GTK3: using wrong style for pre-edit area

Problem:  GTK3: using wrong style for pre-edit area
Solution: remove the widget name, adjust css
          (lilydjwg)

closes: #13972

Signed-off-by: lilydjwg <lilydjwg@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoCI: skip apt upgrade on github runners (#13975)
Philip H [Tue, 6 Feb 2024 09:47:49 +0000 (10:47 +0100)] 
CI: skip apt upgrade on github runners (#13975)

Revert: https://github.com/vim/vim/pull/13680
Fixed in: https://github.com/actions/runner-images/issues/9016

Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoCI: Bump codecov/codecov-action from 3 to 4 (#13978)
dependabot[bot] [Tue, 6 Feb 2024 09:46:10 +0000 (10:46 +0100)] 
CI: Bump codecov/codecov-action from 3 to 4 (#13978)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0077: Unnecessary call to redraw_for_cursorline() in nv_mousescroll() v9.1.0077
zeertzjq [Tue, 6 Feb 2024 09:43:36 +0000 (10:43 +0100)] 
patch 9.1.0077: Unnecessary call to redraw_for_cursorline() in nv_mousescroll()

Problem:  The call to redraw_for_cursorline() in nv_mousescroll() is
          unnecessary because redraw_for_cursorline() only sets redraw
          type to UPD_VALID, and all code paths in do_mousescroll()
          already set redraw type to at least UPD_VALID.
Solution: Remove call to redraw_for_cursorline() in nv_mousescroll().
          (zeertzjq)

closes: #13979

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(colors): color names in the v:colornames dict should be lower cased
Christian Brabandt [Mon, 5 Feb 2024 09:30:01 +0000 (10:30 +0100)] 
runtime(colors): color names in the v:colornames dict should be lower cased

Vim will lookup color names from the v:colornames dictionary by its
lower case color name. So when sourcing the v:colornames dictionary,
make sure to convert upper case color names to lower case.

Also, while at it, mention in the documentation, that the dictionary
should contain lower case names only.

fixes: #13976
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0076: luau config file not detected v9.1.0076
lopy [Sun, 4 Feb 2024 09:27:33 +0000 (10:27 +0100)] 
patch 9.1.0076: luau config file not detected

Problem:  luau config file not detected
          (lopy)
Solution: Detect it as jsonc
          (lopy)

fixes: #13960
closes: #13970

Signed-off-by: lopy <70210066+lopi-py@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(vim): Update syntax file (#13969)
dkearns [Sat, 3 Feb 2024 17:18:31 +0000 (04:18 +1100)] 
runtime(vim): Update syntax file (#13969)

Improve string interpolation highlighting.

Use the vimSep group to highlight interpolation braces as vimOperParen
has no highlighting of its own and employs vimSep via matchgroup.

Add vimNumber to the interpolation group's contained list.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: thinca <thinca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0075: insert completion not correct when adding new leader v9.1.0075
glepnir [Sat, 3 Feb 2024 17:11:13 +0000 (18:11 +0100)] 
patch 9.1.0075: insert completion not correct when adding new leader

Problem:  insert completion not correct when adding new leader
Solution: Reset compl_curr_match to compl_shown_match
          (glepnir)

closes: #13957

Co-authored-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0074: did_set_breakat() should be in optionstr.c v9.1.0074
zeertzjq [Sat, 3 Feb 2024 17:08:09 +0000 (18:08 +0100)] 
patch 9.1.0074: did_set_breakat() should be in optionstr.c

Problem:  did_set_breakat() should be in optionstr.c as 'breakat' is a
          string option.
Solution: Move did_set_breakat() to optionstr.c.
          (zeertzjq)

closes: #13958

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0073: Looping over modifier_keys_table unnecessarily v9.1.0073
zeertzjq [Sat, 3 Feb 2024 17:04:05 +0000 (18:04 +0100)] 
patch 9.1.0073: Looping over modifier_keys_table unnecessarily

Problem:  Looping over modifier_keys_table[] unnecessarily with only
          MOD_MASK_ALT or MOD_MASK_CMD, as modifier_keys_table[] only
          contains MOD_MASK_SHIFT and MOD_MASK_CTRL, and the loop won't
          do anything.
Solution: Remove MOD_MASK_ALT and MOD_MASK_CMD from the condition.
          (zeertzjq)

closes: #13963

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0072: Not able to build without FEAT_DIFF v9.1.0072
Yegappan Lakshmanan [Sat, 3 Feb 2024 16:41:54 +0000 (17:41 +0100)] 
patch 9.1.0072: Not able to build without FEAT_DIFF

Problem:  Not able to build without FEAT_DIFF
          (John Marriott, after 9.1.0071)
Solution: Adjust #ifdefs
          (Yegappan Lakshmanan)

closes: #13964

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agotranslation(ca): Fixe typos in Catalan translation (#13968)
Jordi Mas [Sat, 3 Feb 2024 16:40:03 +0000 (17:40 +0100)] 
translation(ca): Fixe typos in Catalan translation (#13968)

Signed-off-by: Jordi Mas <jmas@softcatala.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agopatch 9.1.0071: Need a diff() Vim script function v9.1.0071
Yegappan Lakshmanan [Thu, 1 Feb 2024 21:05:27 +0000 (22:05 +0100)] 
patch 9.1.0071: Need a diff() Vim script function

Problem:  Need a diff() Vim script function
Solution: Add the diff() Vim script function using the
          xdiff internal diff library, add support for
          "unified" and "indices" mode.
          (Yegappan Lakshmanan)

fixes: #4241
closes: #12321

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agotranslation(ru): Updated Russian translation of messages (#13947)
Restorer [Thu, 1 Feb 2024 20:45:32 +0000 (23:45 +0300)] 
translation(ru): Updated Russian translation of messages (#13947)

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
22 months agoruntime(vim): Update syntax file (#13948)
dkearns [Thu, 1 Feb 2024 20:44:26 +0000 (07:44 +1100)] 
runtime(vim): Update syntax file (#13948)

Improve string escape sequence and special key matching.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>