]> git.ipfire.org Git - thirdparty/vim.git/log
thirdparty/vim.git
16 months agopatch 9.1.0209: leaking memory in exe_newdict() on error v9.1.0209
Christian Brabandt [Tue, 26 Mar 2024 17:42:52 +0000 (18:42 +0100)] 
patch 9.1.0209: leaking memory in exe_newdict() on error

Problem:  leaking memory in exe_newdict() on error
          (LuMingYinDetect)
Solution: free allocated dict if GA_GROW_FALIS()

fixes: #14255
closes: #14281

Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0208: winfixbuf does not allow to re-edit current buffer v9.1.0208
Colin Kennedy [Tue, 26 Mar 2024 17:29:30 +0000 (18:29 +0100)] 
patch 9.1.0208: winfixbuf does not allow to re-edit current buffer

Problem:  winfixbuf does not allow to re-edit current buffer
          (Tim Pope, after v9.1.0147)
Solution: Explicitly allow :e even when 'winfixbuf' is set,
          since it just re-loads the current buffer
          (Colin Kennedy)

fixes: #14237
closes: #14286

Signed-off-by: Colin Kennedy <colinvfx@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0207: No autocommand when writing session file v9.1.0207
Colin Kennedy [Tue, 26 Mar 2024 17:20:16 +0000 (18:20 +0100)] 
patch 9.1.0207: No autocommand when writing session file

Problem:  No autocommand when writing session file
Solution: Add SessionWritePost autocommand
          (Colin Kennedy)

fixes: ##14242
closes: #14288

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Colin Kennedy <colinvfx@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(java): Update java[CR]_JavaLang type lists (#14297)
Aliaksei Budavei [Tue, 26 Mar 2024 17:12:05 +0000 (20:12 +0300)] 
runtime(java): Update java[CR]_JavaLang type lists (#14297)

- Add to the list of java.lang runtime exceptions two new
  types: MatchException (Pattern Matching for _switch_) and
  WrongThreadException (Virtual Threads).
- "Demote" Compiler (removed in JDK 21) from the list of
  java.lang class types to a new list javaLangDeprecated.

References:
https://bugs.openjdk.org/browse/JDK-8205129
https://bugs.openjdk.org/browse/JDK-8282274
https://bugs.openjdk.org/browse/JDK-8284161

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoUpdate README.md (#14302)
partev [Tue, 26 Mar 2024 17:09:05 +0000 (13:09 -0400)] 
Update README.md (#14302)

fix URL for MacVim

Signed-off-by: partev <petrosyan@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0206: unused display_text_first boolean var in win_line() v9.1.0206
Dylan Thacker-Smith [Tue, 26 Mar 2024 17:05:01 +0000 (18:05 +0100)] 
patch 9.1.0206: unused display_text_first boolean var in win_line()

Problem:  unused display_text_first boolean var in win_line()
Solution: Remove unused display_text_first boolean variable
          (Dylan Thacker-Smith)

The only place it is used, uses its initial constant value, then the
following conditionally values set to the variable are unused.

Specifically, it was commit 234c3fab28c14846b962c90097496b27ee1b4df8
that changed the use of display_text_first such that it doesn't have any
effect.

closes: #14305

Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0205: Cannot use modifiers before :-Ntabmove v9.1.0205
zeertzjq [Mon, 25 Mar 2024 15:41:06 +0000 (16:41 +0100)] 
patch 9.1.0205: Cannot use modifiers before :-Ntabmove

Problem:  Cannot use modifiers before :-Ntabmove.
Solution: Check backwards from the command instead of checking from the
          start of the command line. Slightly adjust docs to make them
          more consistent (zeertzjq).

closes: #14289

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoNSIS: Redesigning the appearance of the vimrc settings page (#14292)
Restorer [Mon, 25 Mar 2024 15:38:37 +0000 (15:38 +0000)] 
NSIS: Redesigning the appearance of the vimrc settings page (#14292)

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0204: Backspace inserts spaces with virtual text and 'smarttab' v9.1.0204
zeertzjq [Mon, 25 Mar 2024 15:34:51 +0000 (16:34 +0100)] 
patch 9.1.0204: Backspace inserts spaces with virtual text and 'smarttab'

Problem:  Backspace inserts spaces with virtual text and 'smarttab'.
Solution: Ignore virtual text and wrapping when backspacing.
          (zeertzjq)

related: neovim/neovim#28005
closes: #14296

Co-authored-by: VanaIgr <vanaigranov@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(doc): Update options.txt
Song-Tianxiang [Mon, 25 Mar 2024 15:31:02 +0000 (16:31 +0100)] 
runtime(doc): Update options.txt

closes: #14295

Signed-off-by: Song-Tianxiang <149415622+Song-Tianxiang@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0203: build-error on GNU/Hurd v9.1.0203
James McCoy [Mon, 25 Mar 2024 15:22:23 +0000 (16:22 +0100)] 
patch 9.1.0203: build-error on GNU/Hurd

Problem:  build-error on GNU HURD
Solution: Define _XOPEN_SOURCE like for Android and Cygwin
          (James McCoy)

strptime() requires _XOPEN_SOURCE to be defined for its declaration to
be visible.  This is already done for non-Android Linux and Cygwin, but
also needs to be exposed for GNU/Hurd.

closes: #14285

Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(java): Recognise the inline kind of the {@return} tag (#14284)
Aliaksei Budavei [Mon, 25 Mar 2024 15:18:28 +0000 (18:18 +0300)] 
runtime(java): Recognise the inline kind of the {@return} tag (#14284)

Also:

- Refine comment matching (javaComment{Error\ and,Start}).
- Continue rewriting regexps (prefer atom grouping with
  non-capturing parens; factor out common prefixes in
  alternations).
- Allow for relative paths with the _file_ attribute of
  {@snippet}.
- Anticipate HTML in the @see tags.
- Match the nullary method parens in javaDocSeeTagParam.
- Improve the boundary patterns for summary sentences of
  documentation.

> This sentence ends at ... or at the first tag (as defined
> below).

There are Java documentation tags (@) and there are HTML
tags (<?>) (with Markdown looming large; see JEP 467).  With
block tags, e.g. @param, @return, @see, we begin another
documentation "sentence" whether or not the author has
terminated the summary sentence with a period; with
.<!-- -->, we may follow abbreviations, enumerations,
initials, (but instead consider @literal or &nbsp;) _within_
the summary sentence.  On the other hand, inline tags, e.g.
@code, @link, @literal, should not terminate the summary
sentence.

References:
https://bugs.openjdk.org/browse/JDK-8075778
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#firstsentence
https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(netrw): Fix typo in netrw#NetWrite (#14283)
dkearns [Sun, 24 Mar 2024 16:47:37 +0000 (03:47 +1100)] 
runtime(netrw): Fix typo in netrw#NetWrite (#14283)

Fix typo in netrw#NetWrite (http) error message call.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoNSIS: Update nsis installer and nsis docs (#14256)
Restorer [Sun, 24 Mar 2024 09:41:18 +0000 (09:41 +0000)] 
NSIS: Update nsis installer and nsis docs (#14256)

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(compiler): update errorformat for dot and neato compiler (#14257)
Enno [Sun, 24 Mar 2024 09:37:56 +0000 (10:37 +0100)] 
runtime(compiler): update errorformat for dot and neato compiler (#14257)

* add errorformat for dot compiler
* add errorformat for neato compiler

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0202: leaking memory in add_user() on failure v9.1.0202
Christian Brabandt [Sun, 24 Mar 2024 08:50:03 +0000 (09:50 +0100)] 
patch 9.1.0202: leaking memory in add_user() on failure

Problem:  leaking memory in add_user() (LuMingYinDetect)
Solution: free user_copy pointer instead of the user ptr

add_user() is called with a user pointer and the user pointer comes
from these functions:
- return value from the getpwent() function (Unix).
- return value from the getpwnam() function (Unix).
- return value from the NetUserEnum() function (MS Windows).

For the first 2 callers, the man page for those functions directly says,
one should not free the returned pointer (since it comes from static
memory).
For the third caller (on MS Windows), the returned buffer is already
freed directly after calling the add_user() function in
NetApiBufferFree(), so this would lead to a double free().

This all indicates, the user ptr is wrongly freed in the add_user()
function and the intention was to free the user_copy pointer instead in
case of an error.

So let's just use that now.

fixes: #14250
closes: #14260

Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0201: gM not working correctly with virt text v9.1.0201
Dylan Thacker-Smith [Sun, 24 Mar 2024 08:46:56 +0000 (09:46 +0100)] 
patch 9.1.0201: gM not working correctly with virt text

Problem:  `gM` would include outer virtual text and its padding when
          getting the line length used to calculate the middle of the
          line, putting the cursor much closer to virtual text lines.
Solution: Exclude outer virtual text in getting the line length for
          `gM`, so that virtual text doesn't influence where the cursor
          is moved to (Dylan Thacker-Smith).

closes: #14262

Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0200: `gj`/`gk` not skipping over outer virtual text lines v9.1.0200
Dylan Thacker-Smith [Sun, 24 Mar 2024 08:43:25 +0000 (09:43 +0100)] 
patch 9.1.0200: `gj`/`gk` not skipping over outer virtual text lines

Problem:  `gj`/`gk` was updating the desired cursor virtual column to
          the outer virtual text, even though the actual cursor position
          was moved to not be on the virtual text, leading the need to
          do an extra `gj`/`gk` to move past each virtual text line.
          (rickhowe)
Solution: Exclude the outer virtual text when getting the line length
          for moving the cursor with `gj`/`gk`, so that no extra
          movement is needed to skip over virtual text lines.
          (Dylan Thacker-Smith)

fixes: #12028
related: #14262

Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(termdebug): allow multibyte characters as breakpoint signs (#14274)
Mihai Ciuraru [Sun, 24 Mar 2024 08:11:06 +0000 (10:11 +0200)] 
runtime(termdebug): allow multibyte characters as breakpoint signs (#14274)

Allow multibyte characters as termdebug signs using slice() function

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Mihai Ciuraru <mihai.ciuraru@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0199: Not enough tests for the slice() function v9.1.0199
zeertzjq [Sat, 23 Mar 2024 07:23:48 +0000 (08:23 +0100)] 
patch 9.1.0199: Not enough tests for the slice() function

Problem:  Not enough tests for the slice() function.
Solution: Test with multibyte chars, and in both Legacy and Vim9 script.
          Update docs to be clearer about how it treats composing chars.
          (zeertzjq)

closes: #14275

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0198: Vim9: compound operators broken for lambdas in an object v9.1.0198
Yegappan Lakshmanan [Fri, 22 Mar 2024 18:56:17 +0000 (19:56 +0100)] 
patch 9.1.0198: Vim9: compound operators broken for lambdas in an object

Problem:  Vim9: compound operators broken for lambdas in an object
          (girishji)
Solution: When using an object from the outer scope, use the LOADOUTER
          instruction to load the object (Yegappan Lakshmanan).

fixes: #14236
closes: #14266

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(vim): Update base-syntax, remove old unused syntax groups. (#14146)
dkearns [Fri, 22 Mar 2024 18:55:25 +0000 (05:55 +1100)] 
runtime(vim): Update base-syntax, remove old unused syntax groups. (#14146)

Remove old unused syntax groups.

- vimRegion, vimPattern and vimKeyword removed in Vim 5.3.
- vimAuSyntax, vimAutoCmdOpt, vimAutoSet and vimStatement removed in 5.6.

The following were linked in :hi commands but never defined with :syn
and, most likely, never used:
 - vimHLMod introduced in 5.0.
 - vimKeycode and vimKeycodeError introduced in 5.4.
 - vimElseif introduced in 5.6.
 - vimFold introduced in 6.4.
 - vimOperStar (and vimoperStar) introduced in 9.0.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0197: Vim9: problem evaluating negated boolean logic v9.1.0197
Yegappan Lakshmanan [Fri, 22 Mar 2024 18:37:29 +0000 (19:37 +0100)] 
patch 9.1.0197: Vim9: problem evaluating negated boolean logic

Problem:  Vim9: problem evaluating negated boolean logic
          (lxhillwind)
Solution: Don't clear the first value on short circuit evaluation
          (Yegappan Lakshmanan)

fixes: #14265
closes: #14269

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoCI: Fix for Sodium version 1.0.19 and MinGW (#14267)
Restorer [Fri, 22 Mar 2024 18:34:52 +0000 (18:34 +0000)] 
CI: Fix for Sodium version 1.0.19 and MinGW (#14267)

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(java): Recognise the {@snippet} documentation tag (#14271)
Aliaksei Budavei [Fri, 22 Mar 2024 18:32:48 +0000 (21:32 +0300)] 
runtime(java): Recognise the {@snippet} documentation tag (#14271)

Remember that ‘code fragments are typically Java source
code, but they may also be fragments of properties files,
source code in other languages, or plain text.’  Therefore,
with these changes, markup tags are highlighted in the Java
source files (as external snippets) and in the {@snippet}
tags.

Also:

- Improve matching of the multi-line {@code} documentation
  tag with any contained balanced braces.
- Recognise the {@literal} documentation tag.
- Highlight stray blanks in comments.

Related to an enhancement proposal for PCRE-like callouts
discussed at https://github.com/vim/vim/issues/11217.

References:
https://openjdk.org/jeps/413
https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoCI: mingw complains about unknown escape sequence: '\l', fails with libsodium (#14259)
Christian Brabandt [Thu, 21 Mar 2024 20:55:22 +0000 (20:55 +0000)] 
CI: mingw complains about unknown escape sequence: '\l', fails with libsodium (#14259)

Problem:  CI: mingw complains about unknown escape sequence: '\l', fails with sodium v1.0.19
Solution: Use other slash instead, also revert sodium version to v1.0.18

Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(vim): Update base-syntax, improve function definition highlighting (#14203)
dkearns [Thu, 21 Mar 2024 19:41:10 +0000 (06:41 +1100)] 
runtime(vim): Update base-syntax, improve function definition highlighting (#14203)

Improve function definition highlighting.

- Match bang and function modifiers - abort etc.
- Only match valid scope modifiers.
- Match listing commands.
- Don't match ex commands in function names.
- Split function syntax groups into :func and :def subgroups.
- Match Vim9-script parameter and return types.
- Limit legacy-script and Vim9-script comments to :func and :def
  definitions, respectively.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0196: filetype: support for gnuplot files is lacking v9.1.0196
RobbiZ98 [Thu, 21 Mar 2024 19:24:51 +0000 (20:24 +0100)] 
patch 9.1.0196: filetype: support for gnuplot files is lacking

Problem:  filetype: support for gnuplot files is lacking
Solution: Also detect *.gnuplot files
          (RobbiZ98)

closes: #14243

Signed-off-by: RobbiZ98 <113035863+RobbiZ98@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0195: memleak with ex_drop, NULL dereference v9.1.0195
Christian Brabandt [Thu, 21 Mar 2024 19:19:00 +0000 (20:19 +0100)] 
patch 9.1.0195: memleak with ex_drop, NULL dereference

Problem:  memleak with ex_drop(), NULL dereference
          (zeertzjq)
Solution: revert back to ex_rewind(), use curbuf instead of buf

fixes: #14246
closes: #14251

Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0194: gcc complains about uninitialized var v9.1.0194
Christian Brabandt [Thu, 21 Mar 2024 19:12:59 +0000 (20:12 +0100)] 
patch 9.1.0194: gcc complains about uninitialized var

Problem:  gcc complains about uninitialized var
          (Tony Mechelynck)
Solution: initialize to NULL

Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0193: May leak memory in completion when ga_grow() fails v9.1.0193
zeertzjq [Thu, 21 Mar 2024 06:11:58 +0000 (07:11 +0100)] 
patch 9.1.0193: May leak memory in completion when ga_grow() fails

Problem:  May leak memory in completion when ga_grow() fails.
Solution: Free "wca" when ga_grow() fails (zeertzjq).

fixes: #14248
closes: #14249

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(colors): don't unnecessarily reload v:colornames dict
Alin Mr [Wed, 20 Mar 2024 19:26:23 +0000 (20:26 +0100)] 
runtime(colors): don't unnecessarily reload v:colornames dict

fixes: #14234
closes: #14235

Signed-off-by: Alin Mr <almr.oss@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0192: drop: don't rewind when editing the same file v9.1.0192
Christian Brabandt [Wed, 20 Mar 2024 19:19:47 +0000 (20:19 +0100)] 
patch 9.1.0192: drop: don't rewind when editing the same file

Problem:  :drop tries to :rewind the argumentlist, which results in E37
          (after v9.1.0046)
Solution: instead of calling ex_rewind(), call open_buffer() only when
          re-using the initial empty buffer

fixes: #14219
closes: #14220

Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0191: Installer does not remove all files v9.1.0191
RestorerZ [Wed, 20 Mar 2024 19:15:51 +0000 (20:15 +0100)] 
patch 9.1.0191: Installer does not remove all files

Problem:  Installer does not remove all files
Solution: Update installer and delete all files on uninstall
          update Sodium library dependency, update Readme
          (RestorerZ)

closes: #14214

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0190: complete_info() returns wrong order of items v9.1.0190
Girish Palya [Wed, 20 Mar 2024 19:07:29 +0000 (20:07 +0100)] 
patch 9.1.0190: complete_info() returns wrong order of items

Problem:  complete_info() returns wrong order of items
          (after v9.0.2018)
Solution: Revert Patch v9.0.2018
          (Girish Palya)

bug fix: complete_info() gives wrong results

1) complete_info() reverses list of items during <c-p>
2) 'selected' item index is wrong during <c-p>
3) number of items returnd can be wrong

Solution:
- Decouple 'cp_number' from 'selected' index since they need not be
  correlated
- Do not iterate the list backwards
- Add targeted tests

Regression introduced by https://github.com/vim/vim/commit/69fb5afb3bc9da24c2fb0eafb0027ba9c6502fc2
Following are unnecessary commits to patch problems from above:
https://github.com/vim/vim/commit/fef66301665027f1801a18d796f74584666f41ef
https://github.com/vim/vim/commit/daef8c74375141974d61b85199b383017644978c

All the tests from above commits are retained though.

fixes: #14204
closes: #14241

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(deb822sources): Add minimal ftplugin (#14240)
James McCoy [Wed, 20 Mar 2024 18:55:05 +0000 (14:55 -0400)] 
runtime(deb822sources): Add minimal ftplugin (#14240)

Set comment related options and avoid automatic line wrapping.

Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0189: Memory leak with "above" virttext and 'relativenumber' v9.1.0189
zeertzjq [Wed, 20 Mar 2024 18:49:20 +0000 (19:49 +0100)] 
patch 9.1.0189: Memory leak with "above" virttext and 'relativenumber'

Problem:  Memory leak with "above" virtual text and 'relativenumber'.
Solution: Free "text_props" and "text_prop_idxs" before returning.
          Also fix off-by-one error causing line number to be drawn
          beyond end of window (zeertzjq).

fixes: #14239
closes: #14241

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0188: filetype: no support for Vento files v9.1.0188
wrapperup [Tue, 19 Mar 2024 17:06:22 +0000 (18:06 +0100)] 
patch 9.1.0188: filetype: no support for Vento files

Problem:  Vento files are not recognized.
Solution: Recognize *.vto files as filetype "vento" (wrapperup)

Vento is a templating engine https://vento.js.org/

closes: #14229

Signed-off-by: wrapperup <wrapperup4@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(vim): Update base-syntax, disallow '.' at start of menu item names (#14232)
dkearns [Tue, 19 Mar 2024 17:04:42 +0000 (04:04 +1100)] 
runtime(vim): Update base-syntax, disallow '.' at start of menu item names (#14232)

Disallow '.' at the start of a menu item name.

This is the menu path separator character and should be escaped with a
'\' in this case.

Partially fixes #14230.  "popup" is still incorrectly matched as the Ex
command.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(syntax-tests): regenerate c_00 and markdown dumps
Christian Brabandt [Mon, 18 Mar 2024 21:07:22 +0000 (22:07 +0100)] 
runtime(syntax-tests): regenerate c_00 and markdown dumps

Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(syntax-tests): include missing changes
Aliaksei Budavei [Mon, 18 Mar 2024 19:39:32 +0000 (20:39 +0100)] 
runtime(syntax-tests): include missing changes

related: #14215

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(rust): Respect no_plugin_maps and no_rust_maps globals (#14221)
MyyPo [Mon, 18 Mar 2024 18:38:09 +0000 (20:38 +0200)] 
runtime(rust): Respect no_plugin_maps and no_rust_maps globals (#14221)

Signed-off-by: myypo <nikirsmcgl@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(syntax-tests): Retrofit input/c.c. with TEST_SETUP
Aliaksei Budavei [Fri, 15 Mar 2024 20:22:02 +0000 (23:22 +0300)] 
runtime(syntax-tests): Retrofit input/c.c. with TEST_SETUP

Also:

- Include a syntax test for Markdown that takes advantage of
  a sourceable setup configuration.
- Update Filelist

closes: #14215

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(syntax-tests): Support sourceable Vim configuration for syntax tests
Aliaksei Budavei [Tue, 5 Mar 2024 19:34:36 +0000 (22:34 +0300)] 
runtime(syntax-tests): Support sourceable Vim configuration for syntax tests

Not all programming languages support comments; without such
support, the TEST_SETUP functionality that offers embeddable
Vim Ex commands may no longer be applicable.

We can achieve similar functionality by storing Ex commands
in a Vim file with its basename matching the basename of the
test file, and having this Vim file sourced, and then having
the test file loaded and tested.  When such a Vim file would
be used for a language that has comments and whose matching
test file has embedded TEST_SETUP lines, we will accommodate
it by letting the TEST_SETUP lines augment and/or overrule
sourced configuration.

Further details can be found in the discussion thread at
https://github.com/vim/vim/discussions/14117.

related: #14215

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(syntax-tests): Support embeddable Vim configuration for syntax tests
Aliaksei Budavei [Tue, 5 Mar 2024 19:34:36 +0000 (22:34 +0300)] 
runtime(syntax-tests): Support embeddable Vim configuration for syntax tests

Currently, the very same syntax file for which a test can
be written is the only place where global variables can be
defined so that the file parts guarded with such variables
can be read during screen dump generation.  This approach
would lead to littering the syntax file with test-related
queries.

Instead, we could borrow the idea of comment-based mechanism
for test setup from the indent test runner.  With it, the
first 20 lines of each test file would be ALWAYS scanned in
search of the TEST_SETUP markers and, when found, the part
between the end of the marker and the end of the line would
be treated as a Vim Ex command.

Note that with these changes, runtime/defaults.vim is no
longer sourced for screen dump generation; however, some of
its functionality is reintroduced.

Further details can be found in the discussion thread at
https://github.com/vim/vim/discussions/14117.

related: #14215

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(doc): Recover some missed commas and periods in starting.txt
Aliaksei Budavei [Mon, 18 Mar 2024 18:24:52 +0000 (19:24 +0100)] 
runtime(doc): Recover some missed commas and periods in starting.txt

Also:

- Insert some missing words;
- Strive for consistency with capitalisation of words;
- Improve shell alias examples.

The gvim words were left alone for now, but they deserve to
be treated like proper names, GVim or GUI Vim, unless these
refer to executable filenames (on *nix systems).

closes: #14194

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0187: filetype: no support for Dafny files v9.1.0187
zeertzjq [Mon, 18 Mar 2024 18:21:48 +0000 (19:21 +0100)] 
patch 9.1.0187: filetype: no support for Dafny files

Problem:  Dafny files are not recognized.
Solution: Recognize *.dfy files as filetype "dafny" (zeertzjq).

Ref: https://dafny.org/
Ref: https://github.com/mlr-msft/vim-loves-dafny

closes: #14226

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(vim): Update base-syntax, improve :highlight command (#14228)
dkearns [Mon, 18 Mar 2024 18:19:51 +0000 (05:19 +1100)] 
runtime(vim): Update base-syntax, improve :highlight command (#14228)

Improve :highlight command highlighting

- Use the same highlight groups for "default link" with and without
  bang.
- Match some common line-continuation use.
- Match :hi clear variants.
- Highlight color-name values.

Resync vim.vim and generator/vim.vim.base.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(doc): clarify close behaviour for :term
Christian Brabandt [Sun, 17 Mar 2024 19:14:25 +0000 (20:14 +0100)] 
runtime(doc): clarify close behaviour for :term

closes: #14207

Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(go): `goPackageComment` highlighting too broad
Matthew Hughes [Sun, 17 Mar 2024 19:05:23 +0000 (20:05 +0100)] 
runtime(go): `goPackageComment` highlighting too broad

Previously this would highlight any comment before a line starting
`package`, for example

    var (
      // This comment would be highlighted as a goPackageComment
      packages []string
    )

The package clause is only valid when followed by a space[1], so include
this restriction

This is upstreaming a change from `go-vim`[2]

[1] https://go.dev/ref/spec#Package_clause
[2] https://github.com/fatih/vim-go/commit/d1c36cc4173093d0be78fd826978a024febe6233

Signed-off-by: Matthew Hughes <matthewhughes934@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0186: cursor pos wrong on mouse click after eol with 'rl', 've' and conceal v9.1.0186
zeertzjq [Sun, 17 Mar 2024 18:44:30 +0000 (19:44 +0100)] 
patch 9.1.0186: cursor pos wrong on mouse click after eol with 'rl', 've' and conceal

Problem:  Wrong cursor position when clicking after end of line with
          'rightleft', 'virtualedit' and conceal.
Solution: Set values in ScreenCols[] also with SLF_RIGHTLEFT.  Also fix
          off-by-one cursor position with 'colorcolumn' (zeertzjq).

closes: #14218

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0185: 'wincolor' hl missing with 'rightleft', "below" virttext, 'nowrap' v9.1.0185
zeertzjq [Sun, 17 Mar 2024 09:01:47 +0000 (10:01 +0100)] 
patch 9.1.0185: 'wincolor' hl missing with 'rightleft', "below" virttext, 'nowrap'

Problem:  'wincolor' highlight missing with 'rightleft', "below" virtual
          text and 'nowrap'.
Solution: Handle 'rightleft' in draw_screen_line() (zeertzjq).

closes: #14216

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(indent-test): MS-Windows: Add Makefile for running indent tests
RestorerZ [Sat, 16 Mar 2024 14:08:53 +0000 (15:08 +0100)] 
runtime(indent-test): MS-Windows: Add Makefile for running indent tests

A few more unrelated changes:
- fix Vim script style of indent test
- Change comments to complete sentences in Filelist

closes: #14198

16 months agopatch 9.1.0184: Cursor pos wrong when clicking with conceal and wrap v9.1.0184
zeertzjq [Sat, 16 Mar 2024 14:03:33 +0000 (15:03 +0100)] 
patch 9.1.0184: Cursor pos wrong when clicking with conceal and wrap

Problem:  Cursor position wrong when clicking with conceal and wrap.
Solution: Use the virtual column of the last char for ScreenCols[] in
          boguscols.  Remove use of MAXCOL in ScreenCols[].  Rename
          third argument of wlv_screen_line() to "clear_end" as that's
          clearer what it does (zeertzjq).

related: 14192
closes: #14200

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0183: Wrong display or screenpos() result when toggling diff mode v9.1.0183
zeertzjq [Sat, 16 Mar 2024 08:40:22 +0000 (09:40 +0100)] 
patch 9.1.0183: Wrong display or screenpos() result when toggling diff mode

Problem:  Wrong display or screenpos() result when toggling diff mode.
Solution: Reset w_skipcol when disabling 'wrap'.  Reset w_leftcol when
          enabling 'wrap' (zeertzjq).

fixes: #14210
closes: #14211

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agopatch 9.1.0182: Can define function with invalid name inside 'formatexpr' v9.1.0182
zeertzjq [Sat, 16 Mar 2024 08:39:06 +0000 (09:39 +0100)] 
patch 9.1.0182: Can define function with invalid name inside 'formatexpr'

Problem:  Can define function with invalid name inside 'formatexpr'.
Solution: Use goto instead of checking for did_emsg later.
          (zeertzjq)

closes: #14209

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agotools/rename.bat uses 'mv' and "move" (#14201)
Restorer [Sat, 16 Mar 2024 08:38:10 +0000 (08:38 +0000)] 
tools/rename.bat uses 'mv' and "move" (#14201)

refactor tools/rename.bat and support both "mv" for Linux build environments
and "move" for Windows build environments

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(doc): make :h tag-! more consistent (#14208)
zeertzjq [Sat, 16 Mar 2024 08:21:20 +0000 (16:21 +0800)] 
runtime(doc): make :h tag-! more consistent (#14208)

- Use "on" and "off" for 'winfixbuf' option values.
- Retab the table.

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
16 months agoruntime(vim): Update base-syntax, revert last change to vimUserFunc (#14202)
dkearns [Fri, 15 Mar 2024 17:53:53 +0000 (04:53 +1100)] 
runtime(vim): Update base-syntax, revert last change to vimUserFunc (#14202)

Fix highlighting of ":echo (expr)" (broken in commit 61887b3) by
re-enabling the original fix for #9987.

Addresses https://github.com/vim/vim/pull/14199#issuecomment-1999732062.

This will be fixed more generally when there is context-sensitive
matching for commands and functions.

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 and :execute highlighting (#14199)
dkearns [Fri, 15 Mar 2024 12:45:48 +0000 (23:45 +1100)] 
runtime(vim): Update base-syntax, improve :echo and :execute highlighting (#14199)

Improve :echo and :execute highlighting.

- Add better line-continuation support for both commands.
- Improve the :execute command's expression argument matching.
- Remove the fix for issue #9987 as this is now handled by correctly
  matching the parens in :echo (...) as operator parens.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0181: no overflow check for string formatting v9.1.0181
Christ van Willegen [Thu, 14 Mar 2024 17:30:41 +0000 (18:30 +0100)] 
patch 9.1.0181: no overflow check for string formatting

Problem:  no overflow check for string formatting
Solution: Check message formatting function for overflow.
          (Chris van Willegen)

closes: #13799

Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0180: Cursor pos wrong when double-width chars are concealed v9.1.0180
zeertzjq [Thu, 14 Mar 2024 17:22:17 +0000 (18:22 +0100)] 
patch 9.1.0180: Cursor pos wrong when double-width chars are concealed

Problem:  Cursor pos wrong when double-width chars are concealed.
Solution: Advance one more virtual column for a double-width char.
          Run some tests with both 'wrap' and 'nowrap' (zeertzjq).

closes: #14197

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0179: 'wincolor' highlight missing with "below" virtual text v9.1.0179
zeertzjq [Thu, 14 Mar 2024 17:16:56 +0000 (18:16 +0100)] 
patch 9.1.0179: 'wincolor' highlight missing with "below" virtual text

Problem:  'wincolor' highlight missing with "below" virtual text.
Solution: Subtract n_attr_skip from n_attr.  Combine 'wincolor' with
          other highlights when 'nowrap' is set. (zeertzjq)

closes: #14196

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(mswin): still another clipboard_working test
Christian Brabandt [Thu, 14 Mar 2024 06:55:48 +0000 (07:55 +0100)] 
runtime(mswin): still another clipboard_working test

Commit 760f664213dea9a300454992ba1589f4601d622f missed to revert back
another test for `if has('clipboard_working')`

So change the remaining check around the inoremap <c-v> mappings.

fixes #14195

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0178: E1513 might be confusing v9.1.0178
Christian Brabandt [Wed, 13 Mar 2024 19:59:27 +0000 (20:59 +0100)] 
patch 9.1.0178: E1513 might be confusing

Problem:  E1513 might be confusing
          (Christoph Thoma)
Solution: reword error message, fix test to not
          depend on the actual message

fixes: #14189

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0177: Coverity reports dead code v9.1.0177
zeertzjq [Wed, 13 Mar 2024 19:42:26 +0000 (20:42 +0100)] 
patch 9.1.0177: Coverity reports dead code

Problem:  Coverity reports dead code.
Solution: Remove the dead code. Also fix a mistake in ml_get_pos_len()
          and update some comments (zeertzjq).

closes: #14189

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0176: Cursor column wrong with 'virtualedit' and conceal v9.1.0176
zeertzjq [Wed, 13 Mar 2024 19:38:26 +0000 (20:38 +0100)] 
patch 9.1.0176: Cursor column wrong with 'virtualedit' and conceal

Problem:  Cursor column wrong with 'virtualedit' and conceal.
Solution: Correct cursor column at end of line if never reached.
          (zeertzjq)

closes: #14190

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0175: wrong window positions with 'winfix{width,height}' v9.1.0175
Sean Dewar [Wed, 13 Mar 2024 19:17:24 +0000 (20:17 +0100)] 
patch 9.1.0175: wrong window positions with 'winfix{width,height}'

Problem:  winframe functions incorrectly recompute window positions if
          the altframe wasn't adjacent to the closed frame, which is
          possible if adjacent windows had 'winfix{width,height}' set.

Solution: recompute for windows within the parent of the altframe and
          closed frame. Skip this (as before) if the altframe was
          top/left, but only if adjacent to the closed frame, as
          positions won't change in that case. Also correct the return
          value documentation for win_screenpos. (Sean Dewar)

The issue revealed itself after removing the win_comp_pos call below
winframe_restore in win_splitmove. Similarly, wrong positions could result from
windows closed in other tabpages, as win_free_mem uses winframe_remove (at least
until it is entered later, where enter_tabpage calls win_comp_pos).

NOTE: As win_comp_pos handles only curtab, it's possible via other means for
positions in non-current tabpages to be wrong (e.g: after changing 'laststatus',
'showtabline', etc.). Given enter_tabpage recomputes it, maybe it's intentional
as an optimization? Should probably be documented in win_screenpos then, but I
won't address that here.

closes: #14191

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrap v9.1.0174
zeertzjq [Wed, 13 Mar 2024 19:06:34 +0000 (20:06 +0100)] 
patch 9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrap

Problem:  'cursorline' and 'wincolor' highlight missing with concealed and
          wrapped lines.
Solution: Apply 'cursorline' and 'wincolor' highlight to boguscols.
          (zeertzjq)

Since 'cursorline' and 'wincolor' highlight apply after the end of the
line, it is more consistent to have them also apply to boguscols.

Assigning MAXCOL to values in ScreenCols[] make mouse click behave the
same with 'cursorline' and 'nocursorline', but such behavior may be
incorrect, as it puts the cursor on the next screen line.  That may be
fixed in a future PR.

closes: #14192

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(mswin): revert back the check for clipboard_working support
Christian Brabandt [Wed, 13 Mar 2024 15:38:16 +0000 (16:38 +0100)] 
runtime(mswin): revert back the check for clipboard_working support

Commit d9ebd46bd090c598adc82e6 changed the condition to
check if the clipboard is available from:
```
has('clipboard')
```
to
```
has('clipboard_working')
```
Assuming that is the more accurate test because even when clipboard
support is enabled at compile time it may not be actually working (e.g.
if no X11 environment is available, or when working on a remote server).

However it seems that condition does not evaluate to true, when the GUI
has not been started up yet (and there was no X11 Connection yet possible).

So let's just revert back the check to `has('clipboard')`, since that
has been proven to be working well enough.

related: #13809

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0173: msgfmt ver. 0.22 forcibly converts text to UTF-8 v9.1.0173
RestorerZ [Tue, 12 Mar 2024 21:11:36 +0000 (22:11 +0100)] 
patch 9.1.0173: msgfmt ver. 0.22 forcibly converts text to UTF-8

Problem:  msgfmt ver. 0.22 forcibly converts text to UTF-8
Solution: use '--no-convert' if msgfmt supports it. Add a configure
          check for the msgfmt version (RestorerZ).

closes: #14163

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(doc): add reference to matchbufline() at :h search()
Christian Brabandt [Tue, 12 Mar 2024 21:03:09 +0000 (22:03 +0100)] 
runtime(doc): add reference to matchbufline() at :h search()

related: #14173

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0172: More code can use ml_get_buf_len() instead of STRLEN() v9.1.0172
zeertzjq [Tue, 12 Mar 2024 20:50:32 +0000 (21:50 +0100)] 
patch 9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()

Problem:  More code can use ml_get_buf_len() instead of STRLEN().
Solution: Change more STRLEN() calls to ml_get_buf_len().  Also do not
          set ml_line_textlen in ml_replace_len() if "has_props" is set,
          because "len_arg" also includes the size of text properties in
          that case. (zeertzjq)

closes: #14183

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0171: Small split-move related improvements v9.1.0171
Sean Dewar [Tue, 12 Mar 2024 20:11:39 +0000 (21:11 +0100)] 
patch 9.1.0171: Small split-move related improvements

Problem:  small improvements can be made to split-move related
          functions.
Solution: apply them (Sean Dewar):

- Improve some doc comments (frame_flatten should still work for non-current
  tabpages, despite the topframe check, which looks benign, though I'm unsure if
  it's still needed; see #2467).

- f_win_splitmove should check_split_disallowed on wp, not targetwin, as that's
  what win_splitmove checks (though it's probably unnecessary to check
  b_locked_split at all; see #14109, which I hope to get around to finishing at
  some point).

- Make winframe_restore restore window positions for the altframe, which
  winframe_remove changes. This doesn't affect the prior behaviour, as we called
  win_comp_pos after, but as win_comp_pos only works for curtab, and
  winframe_remove supports non-current tabpages, we should undo it. Regardless,
  this should mean we don't need win_comp_pos anymore; adjust tests to check
  that window positions remain unchanged.

  I'm not sure win_comp_pos is needed after last_status anyway if it doesn't
  steal rows from another frame to make room for a new statusline, which
  shouldn't be the case after winframe_remove? To be safe, I'll leave it as is.

closes: #14185

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0170: Re-allow curwin == prevwin, but document it instead v9.1.0170
Sean Dewar [Tue, 12 Mar 2024 19:46:12 +0000 (20:46 +0100)] 
patch 9.1.0170: Re-allow curwin == prevwin, but document it instead

Problem:  more places exist where curwin == prevwin, and it may even be
          expected in some cases.
Solution: revert v9.1.0001, but document that it's possible instead.
          (Sean Dewar)

I've had a change of heart for the following reasons:

- A quick 'n dirty [GitHub code
  search](https://github.com/search?q=%2F%28winnr%5C%28%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%7Cwinnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5C%29%29%2F&type=code)
  reveals some cases where it's expected in the wild.

  Particularly, it made me aware `winnr() == winnr('#')` is possible when curwin
  is changed temporarily during the evaluation of a &statusline expression item
  (`%{...}`), and is used to show something different on the statusline
  belonging to the previous window; that behaviour wasn't changed in v9.1.0001,
  but it means curwin == prevwin makes sense in some cases.

- The definition and call sites of back_to_prevwin imply some expectation that
  prevwin == wp (== curwin) is possible, as it's used to skip entering the
  prevwin in that case.

- Prior to v9.1.0001, `:wincmd p` would not beep in the case that was patched in
  v9.1.0001, but now does. That resulted in #14047 being opened, as it affected
  the CtrlP plugin.

  I find it odd that `:wincmd p` had cases where it wouldn't beep despite doing
  nothing, but it may be preferable to keep things that way (or instead also
  beep if curwin == prevwin, if that's preferred).

- After more digging, I found cases in win_free_mem, enter_tabpage,
  aucmd_restbuf and qf_open_new_cwindow where curwin == prevwin is possible
  (many of them from autocommands). Others probably exist too, especially in
  places where curwin is changed temporarily.

fixes: #14047
closes: #14186

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0169: current window number returned by tabpagewinnr may be outdated v9.1.0169
Sean Dewar [Tue, 12 Mar 2024 19:42:25 +0000 (20:42 +0100)] 
patch 9.1.0169: current window number returned by tabpagewinnr may be outdated

Problem:  current window number returned by tabpagewinnr may be outdated
          when called from win_execute for the original tabpage.
Solution: update the original tabpage's tp_curwin in switch_win; use
          {un}use_tabpage instead. Don't do it in restore_win to ensure
          tp_curwin of the temporarily visited tabpage is unchanged from
          switch_win visiting it, as before. (Sean Dewar)

Maybe restore_win should only restore tp_curwin if
`curtab == switchwin->sw_curtab`, in case the user changed tabpages from within
win_execute, but not doing that is consistent with the old behaviour.

related: #14186

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0168: too many STRLEN() calls v9.1.0168
John Marriott [Mon, 11 Mar 2024 21:04:45 +0000 (22:04 +0100)] 
patch 9.1.0168: too many STRLEN() calls

Problem:  too many STRLEN() calls
Solution: Make use of ml_get_len() calls instead
          (John Marriott)

closes: #14123

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(vim): Update base-syntax, improve number matching (#14175)
dkearns [Mon, 11 Mar 2024 20:40:58 +0000 (07:40 +1100)] 
runtime(vim): Update base-syntax, improve number matching (#14175)

- Limit blob literals to an even number of hexadecimal digits and
  correctly located dots.
- Match octal numbers.

The current version unsuccessfully attempts to match a leading '-' as
part of the float literal.  It's actually parsed as part of the literal
for all numbers but the syntax file hasn't matched it like that for a
long time and highlights negative numbers as UNARY-MINUS NUMBER.  This
will be fixed when better expression matching is implemented.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0167: Changing buffer in another window causes it to show matchparen v9.1.0167
zeertzjq [Mon, 11 Mar 2024 20:38:58 +0000 (21:38 +0100)] 
patch 9.1.0167: Changing buffer in another window causes it to show matchparen

Problem:  Changing buffer in another window using win_execute() causes
          it to show matchparen (after 9.0.0969).
Solution: Delay highlighting with SafeState in BufWinEnter.
          (zeertzjq)

closes: #14177

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0166: Internal error with blockwise getregion() in another buffer v9.1.0166
zeertzjq [Mon, 11 Mar 2024 20:36:42 +0000 (21:36 +0100)] 
patch 9.1.0166: Internal error with blockwise getregion() in another buffer

Problem:  Internal error with blockwise getregion() in another buffer
Solution: Also change curwin->w_buffer when changing curbuf (zeertzjq)

closes: #14179

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agotranslation(lt): Update Lithuanian translation of Vim tutor to v.1.7 (#14176)
Rimas Kudelis [Mon, 11 Mar 2024 15:15:04 +0000 (17:15 +0200)] 
translation(lt): Update Lithuanian translation of Vim tutor to v.1.7 (#14176)

Signed-off-by: Rimas Kudelis <rimas@kudelis.lt>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(doc): improve 'winfixbuf' docs (#14180)
zeertzjq [Mon, 11 Mar 2024 15:13:16 +0000 (23:13 +0800)] 
runtime(doc): improve 'winfixbuf' docs (#14180)

- Make it not sound like a buffer option.
- "!" is called a modifier, not an option.

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agoruntime(doc): Update Markdown syntax, add missing configs
Christian Brabandt [Sun, 10 Mar 2024 18:32:55 +0000 (19:32 +0100)] 
runtime(doc): Update Markdown syntax, add missing configs

fixes: #14168

Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0165: Vim9: Importing an autoload imported script fails v9.1.0165
Yegappan Lakshmanan [Sun, 10 Mar 2024 18:22:38 +0000 (19:22 +0100)] 
patch 9.1.0165: Vim9: Importing an autoload imported script fails

Problem:  Vim9: Importing an autoload imported script fails
          (Song-Tianxiang)
Solution: Return the script ID in this case
          (Yegappan Lakshmanan)

fixes: #14171
closes: #14174

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0164: Internal error when passing invalid position to getregion() v9.1.0164
zeertzjq [Sun, 10 Mar 2024 14:46:58 +0000 (15:46 +0100)] 
patch 9.1.0164: Internal error when passing invalid position to getregion()

Problem:  Internal error or crash when passing invalid position to
          getregion().
Solution: Give an error for invalid position (zeertzjq).

closes: #14172

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0163: Calling STRLEN() to compute ml_line_textlen when not needed v9.1.0163
zeertzjq [Sun, 10 Mar 2024 07:55:42 +0000 (08:55 +0100)] 
patch 9.1.0163: Calling STRLEN() to compute ml_line_textlen when not needed

Problem:  Calling STRLEN() to compute ml_line_textlen when not needed.
Solution: Use 0 when STRLEN() will be required and call STRLEN() later.
          (zeertzjq)

closes: #14155

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
17 months agopatch 9.1.0162: problem with writing extended attributes on failure v9.1.0162
Paul R. Tagliamonte [Sun, 10 Mar 2024 07:35:10 +0000 (08:35 +0100)] 
patch 9.1.0162: problem with writing extended attributes on failure

Problem:  problem with writing extended attributes on failure
Solution: Change return type to ssize_t and check listxattr's return
          value correctly on failure (Paul Tagliamonte)

The existing logic will return when the listxattr call returns with the
errno set to ENOTSUP (or a size of 0 bytes), without checking to see if
listxattr actually failed. listxattr can fail with at least E2BIG,
ENOTSUP, ERANGE, or anything that `stat(2)` can fail with (in my case;
ENOENT from stat).

The returned size is stored to a size_t, but the return type is a
ssize_t. On failure, listxattr returns -1, which will get translated to
size_t's MAX. If the listxattr call failed with anything other than
ENOTSUP, this triggers a request for size_t MAX bytes.

This means that, if the listxattr call fails with anything other than
ENOTSUP on save, vim will error with

`E342: Out of memory!  (allocating 18446744073709551615 bytes)`

(keen observers will note 18446744073709551615 is 0xffffffffffffffff)

In reality, this is likely masking a different (usually filesystem?)
error -- but at least it's an error being pushed to the user now, and we
don't try to allocate size_t MAX bytes.

I've opted to change the type that we store listxattr to from size_t to
ssize_t, to match listxattr(2)'s signature, and to check for the -1
return value. Additionally, I've removed the errno check -- if we get a
listxattr failure for any reason, we may as well bail without trying;
it's not like we can even recover.

closes: #14169

Signed-off-by: Paul Tagliamonte <paultag@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>