]> git.ipfire.org Git - thirdparty/vim.git/log
thirdparty/vim.git
17 months agotranslation(lt): Added Lithuanian translation of Tutor v. 1.4 by Laurynas Stančikas...
Rimas Kudelis [Sat, 9 Mar 2024 17:27:46 +0000 (19:27 +0200)] 
translation(lt): Added Lithuanian translation of Tutor v. 1.4 by Laurynas Stančikas (#14118)

This translation has been available for free download from lietuvybe.org,
then lietuvybe.akl.lt, then lietuvybė.lt since at least 2006[1], but noone
ever bothered to contribute it upstream.

[1] https://web.archive.org/web/20060222162117/http://lietuvybe.org/files/vim-tutor-lt.txt

Co-authored-by: Laurynas Stančikas <lasas@gim.ktu.lt>
Signed-off-by: Rimas Kudelis <rimas@kudelis.lt>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(java): Recognise string templates (#14150)
Aliaksei Budavei [Sat, 9 Mar 2024 17:03:11 +0000 (20:03 +0300)] 
runtime(java): Recognise string templates (#14150)

As this is encouraged in the referenced JEPs, "to visually
distinguish a string template from a string literal, and
a text block template from a text block", the default
colours for java\%[Debug]StrTempl are made distinct from
java\%[Debug]String.

According to §3.2 Lexical Translations (JLS, c. 1996 or any
more recent version), line terminators, white space, and
comments are discarded before tokens are accepted. Since
a template expression comprises a template processor, a dot,
and a template, it may be visually appealing to break up
its head across a few lines whenever its tail already spans
multiple lines.  Curiously, no allowance for it is made in
the distributed tests for OpenJDK 21; the proposed regexp
patterns take in consideration a line terminator and white
space after a dot.

References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(vim): Update base-syntax, improve :map highlighting (#14141)
dkearns [Sat, 9 Mar 2024 17:01:22 +0000 (04:01 +1100)] 
runtime(vim): Update base-syntax, improve :map highlighting (#14141)

Improve :map command highlighting.

- Fix multiline RHS matching, allow continued lines and comments.
- Allow ^V-escaped whitespace in LHS.
- Handle map-bar properly and allow trailing commands.

Fixes issue #12672.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0161: expand() removes slash after env variable that ends with colon v9.1.0161
zeertzjq [Sat, 9 Mar 2024 16:44:46 +0000 (17:44 +0100)] 
patch 9.1.0161: expand() removes slash after env variable that ends with colon

Problem:  expand() removes a slash after an environment variable that
          ends with a colon on Windows.
Solution: Check the correct char for a colon (zeertzjq)

closes: #14161

Note: Vim still removes the path-separator at the end, if another path separator
follows directly after it, e.g. on:

```
    echo $FOO='/usr/'
    echo expand('$FOO/bar') == '/usr/bar'
```

see:

,----[ misc1.c:1630 ]
|   // if var[] ends in a path separator and tail[] starts
|   // with it, skip a character
|   if (after_pathsep(dst, dst + c)
| #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
|    && (dst == save_dst || dst[-1] != ':')
| #endif
|    && vim_ispathsep(*tail))
|       ++tail;
`----

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(vim): Update base-syntax, improve :menu{,translate} highlighting (#14162)
dkearns [Sat, 9 Mar 2024 16:43:28 +0000 (03:43 +1100)] 
runtime(vim): Update base-syntax, improve :menu{,translate} highlighting (#14162)

Improve :menu and :menutranslate highlighting.

- Match args to :menutranslation and :popup.
- Only highlight special notation in {rhs} of :menu, like :map.
- Allow line continuations in {rhs} of :menu and between {english} and
  {mylang} of :menutranslation, matching common usage.
- Bug fixes.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0160: Vim9: Add support for using a class type of itself in an object method v9.1.0160
Yegappan Lakshmanan [Sat, 9 Mar 2024 14:44:19 +0000 (15:44 +0100)] 
patch 9.1.0160: Vim9: Add support for using a class type of itself in an object method

Problem:  Add support for using a class type of itself in an object
          method (thinca)
Solution: Vim9: Add support for using a class type of itself in an
          object method (Yegappan Lakshmanan)

fixes: #12369
closes: #14165

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0159: Crash in WinClosed after BufUnload closes other windows v9.1.0159
zeertzjq [Sat, 9 Mar 2024 14:39:27 +0000 (15:39 +0100)] 
patch 9.1.0159: Crash in WinClosed after BufUnload closes other windows

Problem:  Crash in WinClosed after BufUnload closes other windows
Solution: Don't trigger WinClosed if the buffer is NULL (zeertzjq)

Now win_close_othertab() doesn't trigger any autocommands if the buffer
is NULL, so remove the autocmd blocking above (which was added not long
ago in patch v9.0.0550) for consistency.

Also remove an unreachable close_last_window_tabpage() above:
- It is only reached if only_one_window() returns TRUE and last_window()
  returns FALSE.
- If only_one_window() returns TRUE, there is only one tabpage.
- If there is only one tabpage and last_window() returns FALSE, the
  one_window() in last_window() must return FALSE, and the ONE_WINDOW
  in close_last_window_tabpage() must also be FALSE.
- So close_last_window_tabpage() doesn't do anything and returns FALSE.

Then the curtab != prev_curtab check also doesn't make much sense, and
the only_one_window() can be replaced with a check for popup and a call
to last_window() since this is a stricter check than only_one_window().

closes: #14166

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0158: 'shortmess' "F" flag doesn't work properly with 'autoread' v9.1.0158
zeertzjq [Thu, 7 Mar 2024 20:48:33 +0000 (21:48 +0100)] 
patch 9.1.0158: 'shortmess' "F" flag doesn't work properly with 'autoread'

Problem:  'shortmess' "F" flag doesn't work properly with 'autoread'
          (after 9.1.0154)
Solution: Hide the file info message instead of the warning dialog
          (zeertzjq)

closes: #14159
closes: #14158

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0157: Duplicate assignment in f_getregion() v9.1.0157
zeertzjq [Thu, 7 Mar 2024 20:40:53 +0000 (21:40 +0100)] 
patch 9.1.0157: Duplicate assignment in f_getregion()

Problem:  Duplicate assignment in f_getregion().
Solution: Remove the duplicate assignment.  Also improve getregion()
          docs wording and fix an unrelated typo (zeertzjq)

closes: #14154

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0156: Make 'wfb' failing to split still report E1513 v9.1.0156
Sean Dewar [Thu, 7 Mar 2024 20:37:50 +0000 (21:37 +0100)] 
patch 9.1.0156: Make 'wfb' failing to split still report E1513

Problem:  may not be clear why failing to split causes an ":Xdo" command
          to abort if 'wfb' is set.
Solution: do not return immediately if win_split fails, so E1513 is
          still given. Expect both errors in the test. Also fix tests to
          pass CI.
          (Sean Dewar)

closes: #14152

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(syntax-tests): remove executable bit from sh test file
Aliaksei Budavei [Thu, 7 Mar 2024 20:28:39 +0000 (21:28 +0100)] 
runtime(syntax-tests): remove executable bit from sh test file

related: #14138

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0155: can only get getregion() from current buffer v9.1.0155
Shougo Matsushita [Wed, 6 Mar 2024 20:10:18 +0000 (21:10 +0100)] 
patch 9.1.0155: can only get getregion() from current buffer

Problem:  can only call getregion() for current buffer
Solution: Allow to retrieve selections from different buffers
          (Shougo Matsushita)

closes: #14131

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0154: shm=F not respected when reloading buffer with 'autoread' v9.1.0154
Shougo Matsushita [Wed, 6 Mar 2024 19:58:41 +0000 (20:58 +0100)] 
patch 9.1.0154: shm=F not respected when reloading buffer with 'autoread'

Problem:  shm=F not respected when reloading buffer with 'autoread'
Solution: Check SHM_FILEINFO in buf_check_timestamp()
          (Shougo Matsushita)

closes: #14144

Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0153: Text properties corrupted with fo+=aw and backspace v9.1.0153
zeertzjq [Wed, 6 Mar 2024 19:54:22 +0000 (20:54 +0100)] 
patch 9.1.0153: Text properties corrupted with fo+=aw and backspace

Problem:  Text properties corrupted with fo+=aw and backspace
Solution: Allocate line and move text properties
          (zeertzjq)

closes: #14147

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agotranslation(gr): add translation of the installer (#14148)
Christos Longros [Wed, 6 Mar 2024 19:53:02 +0000 (20:53 +0100)] 
translation(gr): add translation of the installer (#14148)

Add greek translation of the installer

Signed-off-by: Christos Longros <98426896+chrislongros@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agotranslation(it): Update Italian translation for winfixbuf
Antonio Giovanni Colombo [Wed, 6 Mar 2024 19:44:10 +0000 (20:44 +0100)] 
translation(it): Update Italian translation for winfixbuf

Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0152: Coverity complains about ignoring return value v9.1.0152
Christian Brabandt [Wed, 6 Mar 2024 18:31:39 +0000 (19:31 +0100)] 
patch 9.1.0152: Coverity complains about ignoring return value

Problem:  Coverity complains about ignoring return value of win_split()
          (after v9.1.150)
Solution: Check if win_split() failed, add winfixbuf.res to Makefile

17 months agopatch 9.1.0151: ml_get_buf_len() does not consider text properties v9.1.0151
Christian Brabandt [Tue, 5 Mar 2024 19:43:25 +0000 (20:43 +0100)] 
patch 9.1.0151: ml_get_buf_len() does not consider text properties

Problem:  ml_get_buf_len() does not consider text properties
          (zeertzj)
Solution: Store text length excluding text properties length
          in addition in the memline

related #14123
closes: #14133

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0150: Several minor 'winfixbuf' issues v9.1.0150
Sean Dewar [Tue, 5 Mar 2024 19:39:07 +0000 (20:39 +0100)] 
patch 9.1.0150: Several minor 'winfixbuf' issues

Problem:  several minor 'winfixbuf' issues exist, mostly relating to the
          quickfix list
Solution: address them and adjust tests. Retab and reflow a few things too.
          (Sean Dewar)

Things touched include:

- Replace the semsgs with gettext'd emsgs.

- Handle window switching in ex_listdo properly, so curbuf and curwin
  are kept in-sync and trigger autocommands; handle those properly.

- Don't change the list entry index in qf_jump_edit_buffer if we fail
  due to 'wfb' (achieved by returning FAIL; QF_ABORT should only be used
  if the list was changed).

- Make qf_jump_edit_buffer actually switch to prevwin when using `:cXX`
  commands **outside** of the list window if 'wfb' is set in curwin.
  Handle autocommands properly in case they mess with the list.

  NOTE: previously, it seemed to split if 'wfb' was set, but do nothing
  and fail if prevwin is *valid*. This behaviour seemed strange, and maybe
  unintentional? Now it aligns more with what's described for the `:cXX`
  commands in the original PR description when used outside a list window,
  I think.

- In both functions, only consider prevwin if 'wfb' isn't set for it;
  fallback to splitting otherwise.

- Use win_split to split. Not sure if there was a specific reason for
  using ex_splitview. win_split is simpler and respects modifiers like
  :vertical that may have been used. Plus, its return value can be checked
  for setting opened_window in qf code (technically win_split_ins autocmds
  could immediately close it or change windows, in which the qf code might
  close some other window on failure; it's already the case elsewhere,
  though).

closes: #14142

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agotranslation(sr): Update Serbian messages (#14143)
Ivan Pešić [Tue, 5 Mar 2024 19:34:00 +0000 (23:34 +0400)] 
translation(sr): Update Serbian messages (#14143)

* translation(sr): Update Serbian messages
* Update serbian.nsi
* Update gvim.nsi

Add serbian language to the installer

Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(c): Recognize "__inline" (#14145)
Wu Yongwei [Tue, 5 Mar 2024 19:27:27 +0000 (03:27 +0800)] 
runtime(c): Recognize "__inline" (#14145)

`__inline` is recognized by GCC, and may even be preferred, as MSVC does
not recognize `__inline__`.

Signed-off-by: Wu Yongwei <wuyongwei@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (#14137)
dkearns [Mon, 4 Mar 2024 18:15:42 +0000 (05:15 +1100)] 
runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (#14137)

* runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups

- Remove contained :syntax and :highlight sub-groups from the function
  body cluster.  These should only match in the respective commands.
- Remove vimSynLine syntax group from several clusters.  The definition
  of vimSynLine was removed in Vim 5.3.

* runtime(vim): Update syntax generator, use standard Last Change date format

The de facto standard date format is YYYY MMM DD.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(sh): Update syntax file, fix issue #962 (#14138)
dkearns [Mon, 4 Mar 2024 18:14:08 +0000 (05:14 +1100)] 
runtime(sh): Update syntax file, fix issue #962 (#14138)

Allow the opening parenthesis of a multiline array assignment, within an
if statement, to appear at EOL.

Fixes issue #962.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0149: null pointer member access when accessing 'winfixbuf' property v9.1.0149
Sean Dewar [Mon, 4 Mar 2024 18:09:26 +0000 (19:09 +0100)] 
patch 9.1.0149: null pointer member access when accessing 'winfixbuf' property

Problem:  qf_goto_win_with_qfl_file may check if prevwin has 'winfixbuf'
          set without checking if it's valid first.
Solution: Reverse the condition. Add a test, a modeline, and a missing
          CheckFeature. (Searn Dewar)

closes: #14140

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(css): update syntax script
Jay Sitter [Mon, 4 Mar 2024 15:19:48 +0000 (16:19 +0100)] 
runtime(css): update syntax script

Signed-off-by: Jay Sitter <jay@jaysitter.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(vim): Update base-syntax, fix issue #14135 (#14136)
dkearns [Sun, 3 Mar 2024 18:02:47 +0000 (05:02 +1100)] 
runtime(vim): Update base-syntax, fix issue #14135 (#14136)

Fix incorrect error highlighting for function calls in :command
definitions.  vimFunctionError should be restricted to :function header
lines.

fixes: #14135

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(doc): Highlight the error message at *E1513*
Christian Brabandt [Sun, 3 Mar 2024 15:47:01 +0000 (16:47 +0100)] 
runtime(doc): Highlight the error message at *E1513*

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(vim): Update base-syntax, improve :augroup highlighting (#14125)
dkearns [Sun, 3 Mar 2024 15:42:47 +0000 (02:42 +1100)] 
runtime(vim): Update base-syntax, improve :augroup highlighting (#14125)

- Explicitly match the bang and group name in :aug! {name}.
- Allow any characters in a group name.
- Match default group switch marker, END.
- Match :aug without arguments (list command).

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(mswin): Use unnamed register when clipboard not working (#13813)
Shixian Li [Sun, 3 Mar 2024 15:41:46 +0000 (23:41 +0800)] 
runtime(mswin): Use unnamed register when clipboard not working (#13813)

* Use unnamed register while clipboard not exist
* Do not need to specify the unnamed register explicitly
fixes: #13809

Signed-off-by: Shixian Li <lsx7@sina.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0148: Vim9: can't call internal methods with objects v9.1.0148
Yegappan Lakshmanan [Sun, 3 Mar 2024 15:26:58 +0000 (16:26 +0100)] 
patch 9.1.0148: Vim9: can't call internal methods with objects

Problem:  Vim9: can't call internal methods with objects
Solution: Add support for empty(), len() and string() function
          calls for objects (Yegappan Lakshmanan)

closes: #14129

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0147: Cannot keep a buffer focused in a window v9.1.0147
Colin Kennedy [Sun, 3 Mar 2024 15:16:47 +0000 (16:16 +0100)] 
patch 9.1.0147: Cannot keep a buffer focused in a window

Problem:  Cannot keep a buffer focused in a window
          (Amit Levy)
Solution: Add the 'winfixbuf' window-local option
          (Colin Kennedy)

fixes:  #6445
closes: #13903

Signed-off-by: Colin Kennedy <colinvfx@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agotranslation(ru): Updated Russian installer translation (#14134)
Restorer [Sun, 3 Mar 2024 14:52:37 +0000 (14:52 +0000)] 
translation(ru): Updated Russian installer translation (#14134)

* translation(ru): Updated Russian translation for NSIS
* update CODEOWNERS

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(java): Recognise text blocks (#14128)
Aliaksei Budavei [Sun, 3 Mar 2024 14:51:01 +0000 (17:51 +0300)] 
runtime(java): Recognise text blocks (#14128)

Also, accept as valid the space escape sequence `\s`.

Also, consistently use the claimed `javaDebug` prefix for
syntax group definitions kept under `g:java_highlight_debug`.

Since `javaStringError` is commented out for its generality,
let's comment out `javaDebugStringError`, its copy, as well.

References:
https://openjdk.org/jeps/378
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7

Closes #10910.

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(r,rhelp,rmd,rnoweb,rrst): Update ftplugin, browsefilter labels (#14126)
dkearns [Sat, 2 Mar 2024 18:27:47 +0000 (05:27 +1100)] 
runtime(r,rhelp,rmd,rnoweb,rrst): Update ftplugin, browsefilter labels (#14126)

Use the standard format for browsefilter labels:
  "File Description (*.ext1, *.ext2, *.ext3)"

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(java): Improve the recognition of literals (#14120)
Aliaksei Budavei [Fri, 1 Mar 2024 22:11:14 +0000 (01:11 +0300)] 
runtime(java): Improve the recognition of literals (#14120)

* Emend the Unicode and octal escape sequence patterns;
* Accept the (repeated) underscore separators in all
  numerical literals;
* Recognise hexadecimal floating-point literals.

(The space escape sequence '\s' will be introduced along
with text blocks in another PR.)

References:
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.3
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.1
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.2
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0146: v:echospace wrong with invalid value of 'showcmdloc' v9.1.0146
zeertzjq [Fri, 1 Mar 2024 22:01:43 +0000 (23:01 +0100)] 
patch 9.1.0146: v:echospace wrong with invalid value of 'showcmdloc'

Problem:  v:echospace wrong after setting invalid value to 'showcmdloc'.
Solution: Only call comp_col() if value is valid.
          (zeertzjq)

closes: #14119

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(doc): some improvements to getregion() docs (#14122)
zeertzjq [Fri, 1 Mar 2024 22:00:23 +0000 (06:00 +0800)] 
runtime(doc): some improvements to getregion() docs (#14122)

- Mention the default selection behavior
- Remove useless sentence
- Correct description about space padding

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(doc,netrw): update "Last Change header", remove trailing whitespace
Christian Brabandt [Thu, 29 Feb 2024 17:12:30 +0000 (18:12 +0100)] 
runtime(doc,netrw): update "Last Change header", remove trailing whitespace

Update Last-Change Header for netrw and doc/indent.txt, fix a trailing
whitespace in indent.txt and make CI happy.

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(netrw): handle file/dir symlinks specifically in tree mode
Christian Brabandt [Thu, 29 Feb 2024 16:48:14 +0000 (17:48 +0100)] 
runtime(netrw): handle file/dir symlinks specifically in tree mode

fixes: #2386
related: #3609

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0145: v:echospace not correct when 'showcmdloc' != last v9.1.0145
Sam-programs [Thu, 29 Feb 2024 16:40:29 +0000 (17:40 +0100)] 
patch 9.1.0145: v:echospace not correct when 'showcmdloc' != last

Problem:  the amount of available space (v:echospace) on the command
          line is not correct when showcmdloc is drawn into the
          statusline or tabline.
Solution: only add SHOWCMD_COLS to the shown command column when
          'showcmdloc' is set to last (Sam-programs)

closes: #14108

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Sam-programs <130783534+Sam-programs@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0144: getregion() needs more tests v9.1.0144
Yegappan Lakshmanan [Thu, 29 Feb 2024 16:30:43 +0000 (17:30 +0100)] 
patch 9.1.0144: getregion() needs more tests

Problem:  getregion() needs more tests
Solution: Run the getregion() test in both the legacy and Vim9 contexts
          (Yegappan Lakshmanan)

closes: #14114

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(yaml): disable multiline_scalar detection by default
Christian Brabandt [Thu, 29 Feb 2024 16:23:51 +0000 (17:23 +0100)] 
runtime(yaml): disable multiline_scalar detection by default

There have been many complaints about Yaml indenting too much, because
it considers values to be multi-line by default, which leads to
unintended indenting for (apparently most) users.

So let's hide this feature behind the new feature flag, keep it
simple and prefer single line value key pairs by default.

If you want the old behaviour, set the following value: >

  :let g:yaml_indent_multiline_scalar = 1

If not set, it will indent the same as the previous line.

closes #13845

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0143: [security]: autocmd causes use-after-free in set_curbuf() v9.1.0143
Christian Brabandt [Wed, 28 Feb 2024 22:32:00 +0000 (23:32 +0100)] 
patch 9.1.0143: [security]: autocmd causes use-after-free in set_curbuf()

Problem:  [security]: autocmd cause use-after-free in set_curbuf()
          (kawarimidoll)
Solution: check side-effect of BufLeave autocommand, when the number
          of windows changed, close windows containing buffers that will
          be wiped, if curbuf changed unexpectedly make sure b_nwindows
          is decremented otherwise it cannot be wiped

set_curbuf() already makes some efforts to ensure the BufLeave
autocommands do not cause issues.  However there are still 2 issues
that are not taken care of:

1) If a BufLeave autocommand opens a new window containing the same
buffer as that is going got be closed in close_buffer() a bit later,
we suddenly have another window open, containing a free'd buffer.  So we
must check if the number of windows changed and if it does (and the
current buffer is going to be wiped (according to the 'bufhidden'
setting), let's immediately close all windows containing the current
buffer using close_windows()

2) If a BufLeave autocommand changes our current buffer (displays it in
the current window), buf->b_nwindow will be incremented. As part of
set_curbuf() we will however enter another buffer soon, which means, the
newly created curbuf will have b_nwindows still have set, even so the
buffer is no longer displayed in a window. This causes later problems,
because it will no longer be possible to wipe such a buffer. So just
before entering the final buffer, check if the curbuf changed when
calling the BufLeave autocommand and if it does (and curbuf is still
valid), decrement curbuf->b_nwindows.

Both issues can be verified using the provided test (however the second
issue only because such an impacted buffer won't be wiped, causing
futher issues in later tests).

fixes: #13839
closes: #14104

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoCI: enable apt upgrade on github runners again to fix i386 build
Philip H [Wed, 28 Feb 2024 22:25:08 +0000 (23:25 +0100)] 
CI: enable apt upgrade on github runners again to fix i386 build

This reverts commit 7f630e6f358275d0bce9fea2665a2763edbf6a0e which
reverted 7349c5160ab63d0737050a6b4da3e407ab0cfeb0

Let's see how many more iterations of reverting a commit we can
achieve...

closes: #14113

Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0142: getregion() can be improved v9.1.0142
Shougo Matsushita [Wed, 28 Feb 2024 21:48:12 +0000 (22:48 +0100)] 
patch 9.1.0142: getregion() can be improved

Problem:  getregion() can be improved (after v9.1.120)
Solution: change getregion() implementation to use pos as lists and
          one optional {opt} dictionary (Shougo Matsushita)

Note: The following is a breaking change!

Currently, the getregion() function (included as of patch v9.1.120) takes
3 arguments: the first 2 arguments are strings, describing a position,
arg3 is the type string.

However, that is slightly inflexible, there is no way to specify
additional arguments. So let's instead change the function signature to:

getregion(pos1, pos2 [, {Dict}]) where both pos1 and pos2 are lists.
This is slightly cleaner, and gives us the flexibility to specify
additional arguments as key/value pairs to the optional Dict arg.

Now it supports the "type" key to specify the selection type
(characterwise, blockwise or linewise) and now in addition one can also
define the selection type, independently of what the 'selection' option
actually is.

Technically, this is a breaking change, but since the getregion()
Vimscript function is still quite new, this should be fine.

closes: #14090

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(Filelist): include runtime/syntax/testdir/ftplugin
Christian Brabandt [Wed, 28 Feb 2024 20:53:26 +0000 (21:53 +0100)] 
runtime(Filelist): include runtime/syntax/testdir/ftplugin

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0141: Put in Visual mode wrong if it replaces fold marker v9.1.0141
zeertzjq [Wed, 28 Feb 2024 20:49:51 +0000 (21:49 +0100)] 
patch 9.1.0141: Put in Visual mode wrong if it replaces fold marker

Problem:  Put in Visual mode wrong if it replaces fold marker.
Solution: Temporarily disable folding during put in Visual mode.
          (zeertzjq)

fixes: #14097
closes: #14100

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(doc): Fix typo under *kitty-terminal* in term.txt
elig0n [Wed, 28 Feb 2024 20:45:48 +0000 (21:45 +0100)] 
runtime(doc): Fix typo under *kitty-terminal* in term.txt

closes: #14106

Signed-off-by: elig0n <31196036+elig0n@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agotranslation(sr): Update Serbian translation (#14107)
Ivan Pešić [Wed, 28 Feb 2024 20:41:27 +0000 (00:41 +0400)] 
translation(sr): Update Serbian translation (#14107)

Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(java): Recognise _when_ clauses in _switch_ blocks
Aliaksei Budavei [Wed, 28 Feb 2024 20:30:22 +0000 (21:30 +0100)] 
runtime(java): Recognise _when_ clauses in _switch_ blocks

Also:

- distinguish _yield_ when used as a contextual keyword from
  when used qualified as a method or a method reference (as
  can be seen in testdir/input/java_switch.java, variables
  and method declarations named _yield_ will be recognised
  as the namesake keyword--consider picking other names for
  variables, and defining g:java_highlight_functions to have
  method names painted; since _yield_ statements can have
  trailing parens, they must be recognised as statements,
  for only qualified _yield_ method calls are supported);

- recognise grouped _default_ _case_ labels;

- describe primitive types for _case_ labels (JLS, §14.11,
  §3.10.1);

- recognise some non-ASCII identifiers (see javaLambdaDef,
  javaUserLabel) (further improvement for better recognition
  of identifiers will be arranged in a separate PR).

Because the arrow '->' is used in two kinds of expressions,
lambda (abstractions) and _switch_, necessary changes were
made for the recognition of either (and further improvement
touching lambda expressions will be separately arranged).

Because 'default' is used for instance method declarations
in interfaces and in _switch_ labels, necessary changes were
made for the recognition of either (and further improvement
touching method declarations will be separately arranged).

Finally, it deemed appropriate to put 'yield' in the syntax
group of javaOperator rather than javaStatement, for its
member 'var' is also another contextual keyword (e.g., this
is valid syntax: "var var = var(test.var);").

References:
https://openjdk.org/jeps/361 (Switch Expressions)
https://openjdk.org/jeps/440 (Record Patterns)
https://openjdk.org/jeps/441 (Pattern Matching for switch)

Also, add a Java specific filetype plugin for the syntax
test, so that no soft-wrapping of long indented lines occur.

Otherwise the syntax scripts would miss a few lines during
scrolling and verification of the screen dumps.

closes: #14105

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(syntax-tests): simplify code and allow filetype options
Christian Brabandt [Wed, 28 Feb 2024 20:24:25 +0000 (21:24 +0100)] 
runtime(syntax-tests): simplify code and allow filetype options

The whole testdir/runtest.vim is a bit of a mess. So this is an attempt
to improving the current state. First of all, let's move most of the
code into a single RunTest() function so that it's easier to run this
manually.

Then, let's add the possibility to customize filetype specific tests by
applying filetype specific options. We will make use of it in the next
commit, where the provided java file uses tabs, which cause line
wrapping which will then cause the scrolling to miss some lines when
redrawing (see #14105)

related: #14105

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agotranslation(it): Update Italian translation
Antonio Giovanni Colombo [Tue, 27 Feb 2024 21:41:22 +0000 (22:41 +0100)] 
translation(it): Update Italian translation

Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0140: cursor on wrong row after 1 char 'below' virtual text when EOL is... v9.1.0140
Dylan Thacker-Smith [Tue, 27 Feb 2024 19:25:10 +0000 (20:25 +0100)] 
patch 9.1.0140: cursor on wrong row after 1 char 'below' virtual text when EOL is shown

Problem:  The cursor screen row was incorrectly being calculated when the
          cursor follows a 1 character text_align 'below' virtual text line,
          resulting in the cursor being shown on the wrong line.
          This was caused by a cell size of 2 instead of 1 being used for the EOL
          character, which propagated to the calculation of space for putting the
          'below' virtual text on its own line. (rickhowe)
Solution: Fix the size used for the EOL character in calculating the
          cursor's screen position (Dylan Thacker-Smith)

fixes: #11959
related: #12028
closes: #14096

Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(sh): Update ftplugin, fix #14101 (#14102)
dkearns [Tue, 27 Feb 2024 19:00:32 +0000 (06:00 +1100)] 
runtime(sh): Update ftplugin, fix #14101 (#14102)

Add the 'b' flag to 'comments', so that the shebang line is not detected as comment.

Fixes #14101.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(vim): Update base-syntax, improve :echo highlighting (#14103)
dkearns [Tue, 27 Feb 2024 18:59:30 +0000 (05:59 +1100)] 
runtime(vim): Update base-syntax, improve :echo highlighting (#14103)

- Normalise behaviour of :echo commands and improve expression matching.
- Allow continued argument lines.
- Refine string interpolation groups.
- Remove duplicated :menu and :map generated commands that are handled
  specially later in the file.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(debian): update Debian syntax files (#14098)
James McCoy [Tue, 27 Feb 2024 06:34:45 +0000 (01:34 -0500)] 
runtime(debian): update Debian syntax files (#14098)

* debversions.vim: Move lunar to unsupported release
* debsources: Add word boundaries around keyword match patterns

Co-authored-by: James Addison <jay@jp-hosting.net>
Signed-off-by: James Addison <jay@jp-hosting.net>
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0139: MS-Windows: ligatures map cleared on startup v9.1.0139
Erik S. V. Jansson [Mon, 26 Feb 2024 21:23:05 +0000 (22:23 +0100)] 
patch 9.1.0139: MS-Windows: ligatures map cleared on startup

Problem:  MS-Windows: ligatures map cleared on startup
Solution: Don't clear the ligatures_map, if the guiligatures
          option has already been set (Erik S. V. Jansson)

If guiligatures is set from a .vimrc it's possible
that it will be cleared on start-up (e.g. in Win32
that's what happens).

So don't clear the ligatures map if gui_set_ligatures()
has already been called (e.g. after setting 'ligatures'
from .vimrc)

closes: #14094

Signed-off-by: Erik S. V. Jansson <caffeineviking@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0138: too many STRLEN calls when getting a memline v9.1.0138
John Marriott [Mon, 26 Feb 2024 20:21:17 +0000 (21:21 +0100)] 
patch 9.1.0138: too many STRLEN calls when getting a memline

Problem:  too many STRLEN calls when getting a memline
Solution: Optimize calls to STRLEN(), add a few functions in memline.c
          that return the byte length instead of relying on STRLEN()
          (John Marriott)

closes: #14052

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(vim): Update syntax file, improve :substitute matching (#14093)
dkearns [Mon, 26 Feb 2024 20:10:18 +0000 (07:10 +1100)] 
runtime(vim): Update syntax file, improve :substitute matching (#14093)

- Differentiate between :substitute and substitute(), fixes #13883.
- Match all allowed :substitute delimiters.
- Remove leading context from :substitute matches.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0137: <Del> in cmdline mode doesn't delete composing chars v9.1.0137
zeertzjq [Mon, 26 Feb 2024 19:38:36 +0000 (20:38 +0100)] 
patch 9.1.0137: <Del> in cmdline mode doesn't delete composing chars

Problem:  <Del> in cmdline mode doesn't delete composing chars
Solution: Use mb_head_off() and mb_ptr2len() (zeertzjq)

closes: #14095

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(doc): Fix typo in usr_41.txt
Doug Kearns [Sun, 25 Feb 2024 14:21:54 +0000 (15:21 +0100)] 
runtime(doc): Fix typo in usr_41.txt

closes: #14092

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(doc): fix inconsistent indent (#14089)
zeertzjq [Sun, 25 Feb 2024 07:42:52 +0000 (15:42 +0800)] 
runtime(doc): fix inconsistent indent (#14089)

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0136: Vim9: need more test for exists() v9.1.0136
Yegappan Lakshmanan [Sun, 25 Feb 2024 07:40:10 +0000 (08:40 +0100)] 
patch 9.1.0136: Vim9: need more test for exists()
methods

Problem:  Vim9: need more test for exists()
Solution: Add test for exists() with class/objct variables and methods
          (Yegappan Lakshmanan)

closes: #14088

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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()

17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>