]> git.ipfire.org Git - thirdparty/vim.git/log
thirdparty/vim.git
2 years agopatch 9.0.2096: Vim9: confusing usage of private v9.0.2096
Ernie Rael [Sat, 11 Nov 2023 07:53:32 +0000 (08:53 +0100)] 
patch 9.0.2096: Vim9: confusing usage of private

Problem:  Vim9: confusing usage of private
Solution: clarify and use protected keyword instead

[vim9class] document `_` as protected instead of private

fixes #13504
closes: #13520

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoCI: labeler.yml: add documentation label (#13506)
Philip H [Thu, 9 Nov 2023 08:51:03 +0000 (09:51 +0100)] 
CI: labeler.yml: add documentation label (#13506)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): fix grammar in termdebug doc, remove trailing spaces (#13505)
zeertzjq [Thu, 9 Nov 2023 07:21:58 +0000 (15:21 +0800)] 
runtime(doc): fix grammar in termdebug doc, remove trailing spaces (#13505)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(termdebug): improve window handling, shorten var types
shane.xb.qian [Wed, 8 Nov 2023 20:59:15 +0000 (21:59 +0100)] 
runtime(termdebug): improve window handling, shorten var types

closes #13474

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(termdebug): handle buffer-local mappings properly
shane.xb.qian [Wed, 8 Nov 2023 20:44:48 +0000 (21:44 +0100)] 
runtime(termdebug):  handle buffer-local mappings properly

closes: #13475

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2095: statusline may look different than expected v9.0.2095
Christian Brabandt [Wed, 8 Nov 2023 20:23:29 +0000 (21:23 +0100)] 
patch 9.0.2095: statusline may look different than expected

Problem:  statusline may look different than expected
Solution: do not check for highlighting of stl and stlnc characters

statusline fillchar may be different than expected

If the highlighting group for the statusline for the current window
|hl-StatusLine| or the non-current window |hl-StatusLineNC| are cleared
(or do not differ from each other), than Vim will use the hard-coded
fallback values '^' (for the non-current windows) or '=' (for the
current window).  I believe this was done, to make sure the statusline
will always be visible and be distinguishable from the rest of the
window.

However, this may be unexpected, if a user explicitly defined those
fillchar characters just to notice that those values are then not used
by Vim.

So, let's assume users know what they are doing and just always return
the configured stl and stlnc values.  And if they want the statusline to
be non-distinguishable from the rest of the window space, so be it.  It
is their responsibility and Vim shall not know better what to use.

fixes: #13366
closes: #13488

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2094: Vim9: need more assignment tests v9.0.2094
Yegappan Lakshmanan [Wed, 8 Nov 2023 20:02:48 +0000 (21:02 +0100)] 
patch 9.0.2094: Vim9: need more assignment tests

Problem:  Vim9: need more assignment tests
Solution: Add test for using different types in assignment, function
          arguments and return values

closes: #13491

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(wget): Update for Wget2 2.1.0 (#13497)
dkearns [Wed, 8 Nov 2023 19:53:20 +0000 (06:53 +1100)] 
runtime(wget): Update for Wget2 2.1.0 (#13497)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2093: Unsupported option causes skipping of modeline test v9.0.2093
zeertzjq [Wed, 8 Nov 2023 19:48:05 +0000 (20:48 +0100)] 
patch 9.0.2093: Unsupported option causes skipping of modeline test

Problem:  Unsupported option causes rest of modeline test to be skipped.
Solution: Revert the change from patch 8.2.1432.

closes: #13499
closes: #13500

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2092: tests: failure in test_arabic v9.0.2092
Christian Brabandt [Sun, 5 Nov 2023 18:17:10 +0000 (19:17 +0100)] 
patch 9.0.2092: tests: failure in test_arabic

Problem:  tests: failure in test_arabic
Solution: adjust the test for the changed arabic keymap

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(keymap): Switch Hindu-Arabic to Arabic numerals in arabic keymap (#13430)
avidseeker [Sun, 5 Nov 2023 16:59:20 +0000 (16:59 +0000)] 
runtime(keymap): Switch Hindu-Arabic to Arabic numerals in arabic keymap (#13430)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agotranslation(ru): Update the translation of Russian messages to Vim 9.0.2091 (#13490)
Restorer [Sun, 5 Nov 2023 16:56:14 +0000 (16:56 +0000)] 
translation(ru): Update the translation of Russian messages to Vim 9.0.2091 (#13490)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(tar): improve the error detection
Christian Brabandt [Sun, 5 Nov 2023 16:44:05 +0000 (17:44 +0100)] 
runtime(tar): improve the error detection

Do not rely on the fact, that the last line matches warning, error,
inappropriate or unrecognized to determine if an error occurred. It
could also be a file, contains such a keyword.

So make the error detection slightly more strict and only assume an
error occured, if in addition to those 4 keywords, also a space matches
(this assumes the error message contains a space), which luckily on Unix
not many files match by default.

The whole if condition seems however slightly dubious.  In case an error
happened, this would probably already be caught in the previous if
statement, since this checks for the return code of the tar program.

There may however be tar implementations, that do not set the exit code
for some kind of error (but print an error message)? But let's keep this
check for now, not many people have noticed this behaviour until now, so
it seems to work reasonably well anyhow.

related: #6425
fixes: #13489
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): document vim-script library function
Christian Brabandt [Sun, 5 Nov 2023 09:45:12 +0000 (10:45 +0100)] 
runtime(doc): document vim-script library function

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(dist): Make dist/vim.vim work properly when lacking vim9script support (...
Sean Dewar [Sun, 5 Nov 2023 09:11:37 +0000 (09:11 +0000)] 
runtime(dist): Make dist/vim.vim work properly when lacking vim9script support (#13487)

`:return` cannot be used outside of `:function` (or `:def`) in older Vims
lacking Vim9script support or in Neovim, even when evaluation is being skipped
in the dead `:else` branch.

Instead, use the pattern described in `:h vim9-mix`, which uses `:finish` to end
script processing before it reaches the vim9script stuff.

Signed-off-by: Sean Dewar <seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2091: Vim9: cannot convert list to string using += v9.0.2091
Yegappan Lakshmanan [Sun, 5 Nov 2023 09:07:03 +0000 (10:07 +0100)] 
patch 9.0.2091: Vim9: cannot convert list to string using +=

Problem:  Vim9: cannot convert list to string using +=
          (after 9.0.2072)
Solution: convert dict index to string later in compile_member()

fixes: #13485
closes: #13486

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(dist): add legacy version for central vim library
Christian Brabandt [Sat, 4 Nov 2023 10:16:23 +0000 (11:16 +0100)] 
runtime(dist): add legacy version for central vim library

Also, enable the zip and gzip plugins by default, unless those variables
were not explicitly set by the user.

related: #13413

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(dist): centralize safe executable check and add vim library (#13413)
D. Ben Knoble [Sat, 4 Nov 2023 09:11:17 +0000 (05:11 -0400)] 
runtime(dist): centralize safe executable check and add vim library (#13413)

Follow up to 816fbcc26 (patch 9.0.1833: [security] runtime file fixes,
2023-08-31) and f7ac0ef50 (runtime: don't execute external commands when
loading ftplugins, 2023-09-06).

This puts the logic for safe executable checks in a single place, by introducing
a central vim library, so all filetypes benefit from consistency.

Notable changes:
- dist#vim because the (autoload) namespace for a new runtime support
  library. Supporting functions should get documentation. It might make
  life easier for NeoVim devs to make the documentation a new file
  rather than cram it into existing files, though we may want
  cross-references to it somewhere…
- The gzip and zip plugins need to be opted into by enabling execution
  of those programs (or the global plugin_exec). This needs
  documentation or discussion.
- This fixes a bug in the zig plugin: code setting s:tmp_cwd was removed
  in f7ac0ef50 (runtime: don't execute external commands when loading
  ftplugins, 2023-09-06), but the variable was still referenced. Since
  the new function takes care of that automatically, the variable is no
  longer needed.

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): clarify terminal capabilities for focus reporting
Christian Brabandt [Sat, 4 Nov 2023 09:03:52 +0000 (10:03 +0100)] 
runtime(doc): clarify terminal capabilities for focus reporting

closes: #13440

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2090: complete_info() skips entries with 'noselect' v9.0.2090
Christian Brabandt [Sat, 4 Nov 2023 08:58:14 +0000 (09:58 +0100)] 
patch 9.0.2090: complete_info() skips entries with 'noselect'

Problem:  complete_info() skips entries with 'noselect'
Solution: Check, if first entry is at original text state

Unfortunately, Commit daef8c74375141974d61b85199b383017644978c
introduced a regression, that when ':set completeopt+=noselect' is set
and no completion item has been selected yet, it did not fill the
complete_info['items'] list.

This happened, because the current match item did not have the
CP_ORIGINAL_TEXT flag set and then the cp->prev pointer did point to the
original flag item, which caused the following while loop to not being
run but being skipped instead.

So when the 'noselect' is set, only start with to the previous selection
item, if the initial completion item has the CP_ORIGINAL_TEXT flag set,
else use the 2nd previous item instead.

fixes: #13451
closes: #13452

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Restorer [Sat, 4 Nov 2023 08:57:09 +0000 (08:57 +0000)] 
runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)

* Makefile for the Vim documentation on Windows

* Corrected comments

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2089: sound_playfile() fails when using powershell v9.0.2089
GuyBrush [Sat, 4 Nov 2023 08:48:53 +0000 (09:48 +0100)] 
patch 9.0.2089: sound_playfile() fails when using powershell

Problem:  sound_playfile() fails when using powershell
Solution: quote filename using doublequotes, don't escape filename,
          because it doesn't use the shell

Avoiding powershell escaping because mci open command doesn't support
single quoted filenames: open 'C:\whatever\sound.wav' is not valid.

closes: #13471

Signed-off-by: GuyBrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2088: Vim9: still allows abstract static methods v9.0.2088
Yegappan Lakshmanan [Sat, 4 Nov 2023 08:42:46 +0000 (09:42 +0100)] 
patch 9.0.2088: Vim9: still allows abstract static methods

Problem:  Vim9: still allows abstract static methods
          (after v9.0.2084, v9.0.2085 and v9.0.2087)
Solution: Disallow abstract static methods

closes: #13479

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(sh): Update sh syntax and add shDerefOffset to shDerefVarArray for bash ...
Lucien Grondin [Sat, 4 Nov 2023 08:41:37 +0000 (09:41 +0100)] 
runtime(sh): Update sh syntax and add shDerefOffset to shDerefVarArray for bash (#13480)

Add shDerefOffset to shDerefVarArray.

Example code:

```bash
declare -a a=({a..z})

echo "${a[@]:1:3}"
```

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(script.vim): make strace ft check less strict (#13482)
Jiri Slaby [Sat, 4 Nov 2023 08:39:54 +0000 (09:39 +0100)] 
runtime(script.vim): make strace ft check less strict (#13482)

Strace output, depending on parameters (-ttf this time), can dump both
times and pid:
  1038  07:14:20.959262 execve("./e.py", ["./e.py"], 0x7ffca1422840 /* 51 vars */) = 0 <0.000150>

So loose the regexp matching this, so that the above is matched too.

Fixes #13481.

Co-authored-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2087: build-failure in vim9class 12146/head v9.0.2087
Christian Brabandt [Thu, 2 Nov 2023 21:45:12 +0000 (22:45 +0100)] 
patch 9.0.2087: build-failure in vim9class

Problem:  build-failure in vim9class
Solution: reference correct error message,
          disable non-failing test

closes: #13476
closes: #13477

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2086: code cleanup for option callbacks needed v9.0.2086
zeertzjq [Thu, 2 Nov 2023 20:01:19 +0000 (21:01 +0100)] 
patch 9.0.2086: code cleanup for option callbacks needed

Problem:  code cleanup for option callbacks needed
Solution: remove flag os_doskip, it's not necessary, as we can check,
          whether an error message was returned

Remove unnecessary field os_doskip

Callback functions for boolean options set os_doskip immediately before
returning an error message, so os_doskip isn't actually needed.

closes: #13461

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2085: Vim9: abstract can be used in interface v9.0.2085
Yegappan Lakshmanan [Thu, 2 Nov 2023 19:57:32 +0000 (20:57 +0100)] 
patch 9.0.2085: Vim9: abstract can be used in interface

Problem:  Vim9: abstract can be used in interface
Solution: Disallow the use of abstract in an interface

fixes: #13456
closes: #13464

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2084: Vim9: abstract static methods are possible v9.0.2084
Yegappan Lakshmanan [Thu, 2 Nov 2023 19:43:57 +0000 (20:43 +0100)] 
patch 9.0.2084: Vim9: abstract static methods are possible

Problem:  Vim9: abstract static methods are possible
Solution: Disallow abstract static methods

fixes: #13462
closes: #13466

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(sh) Update sh syntax and add shDblParen to shCaseList (#13469)
Lucien Grondin [Thu, 2 Nov 2023 19:33:56 +0000 (20:33 +0100)] 
runtime(sh) Update sh syntax and add shDblParen to shCaseList (#13469)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2083: Perl: xsubpp may be in non-standard location v9.0.2083
Zdenek Dohnal [Thu, 2 Nov 2023 19:19:06 +0000 (20:19 +0100)] 
patch 9.0.2083: Perl: xsubpp may be in non-standard location

Problem:  Perl: xsubpp may be in non-standard location
Solution: Add --with-subpp configure option

configure.ac: Add --with-xsubpp configure option

Some environments (such as flatpaks) cannot count on xsubpp being
in the common Perl directory, so a configure option should be used for
clean solution.

closes: #13470

Signed-off-by: Zdenek Dohnal <zdohnal@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(debversions): Add noble (24.04 LTS) as Ubuntu release name (#13472)
James McCoy [Thu, 2 Nov 2023 19:12:29 +0000 (15:12 -0400)] 
runtime(debversions): Add noble (24.04 LTS) as Ubuntu release name (#13472)

Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2082: test_channel may fail because of IPv6 config issue v9.0.2082
James McCoy [Thu, 2 Nov 2023 19:05:38 +0000 (20:05 +0100)] 
patch 9.0.2082: test_channel may fail because of IPv6 config issue

Problem:  test_channel may fail because of IPv6 config issues
Solution: Catch and skip the test, if getaddrinfo() fails with
          'Address family not supported'

Mark tests as skipped when ch_open encounters E901

On some of the Debian build systems, the IPv6 channel tests fail because
`ch_open('[::1]:<port>', ...)` raises the error "E901: getaddrinfo() in
channel_open(): Address family for hostname not supported".

This appears to happen because getaddrinfo() can't perform the reverse
lookup for the ::1, which is a config issue on that system.  Therefore,
instead of reporting a test failure, mark the test as skipped due to the
bad network config

closes: #13473

Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2081: smoothscroll may result in wrong cursor position v9.0.2081
Luuk van Baal [Sat, 28 Oct 2023 19:43:31 +0000 (21:43 +0200)] 
patch 9.0.2081: smoothscroll may result in wrong cursor position

Problem:  With 'smoothscroll' set, "w_skipcol" is not reset when unsetting 'wrap'.
          Resulting in incorrect calculation of the cursor position.
Solution: Reset "w_skipcol" when unsetting 'wrap'.

fixes:  #12970
closes: #13439

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(sh): add shDblParen to shLoopList for bash (#13445)
Lucien Grondin [Sat, 28 Oct 2023 19:40:48 +0000 (21:40 +0200)] 
runtime(sh): add shDblParen to shLoopList for bash (#13445)

add shDblParen to shLoopList to correctly highlight
arithmetic expressions for Bash and Ksh

This should allow code such as:

```bash
declare -i i j
for i in foo bar
do ((j = 1 << j))
done
```

Signed-off-by: Lucien Grondin <grondilu@yahoo.fr>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2080: vim9_script test too large v9.0.2080
Yegappan Lakshmanan [Sat, 28 Oct 2023 19:28:48 +0000 (21:28 +0200)] 
patch 9.0.2080: vim9_script test too large

Problem:  vim9_script test too large
Solution: split vim9 type alias test into
          separate test file

Move type alias tests to a separate test file

closes: #13447

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): all secure options should note this restriction in the documentation...
dkearns [Sat, 28 Oct 2023 19:26:19 +0000 (06:26 +1100)] 
runtime(doc): all secure options should note this restriction in the documentation (#13448)

Problem:  Not all secure options document their status
Solution: Describe secure context :set restrictions in each help entry

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2079: Not all Dart files detected v9.0.2079
Doug Kearns [Sat, 28 Oct 2023 19:19:54 +0000 (21:19 +0200)] 
patch 9.0.2079: Not all Dart files detected

Problem:  Not all Dart files detected
Solution: Add shebang filetype detection for Dart

closes: #13449

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2078: several problems with type aliases v9.0.2078
Yegappan Lakshmanan [Sat, 28 Oct 2023 13:53:55 +0000 (15:53 +0200)] 
patch 9.0.2078: several problems with type aliases

Problem:  several problems with type aliases
Solution: Check for more error conditions, add tests,
          fix issues

Check for more error conditions and add additional tests

fixes  #13434
fixes  #13437
fixes  #13438
closes #13441

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2077: CI fails because of trailing whitespace in test v9.0.2077
Christian Brabandt [Fri, 27 Oct 2023 17:47:29 +0000 (19:47 +0200)] 
patch 9.0.2077: CI fails because of trailing whitespace in test

Problem:  CI fails because of trailing whitespace in test
Solution: Remove it

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2076: Vim9: No support for type aliases v9.0.2076
Yegappan Lakshmanan [Fri, 27 Oct 2023 17:35:26 +0000 (19:35 +0200)] 
patch 9.0.2076: Vim9: No support for type aliases

Problem:  Vim9: No support for type aliases
Solution: Implement :type command

A type definition is giving a name to a type specification.  This also known
type alias.

:type ListOfStrings = list<string>

The type alias can be used wherever a built-in type can be used.  The type
alias name must start with an upper case character.

closes: #13407

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2 years agopatch 9.0.2075: TextChangedI may not always trigger v9.0.2075
Christian Brabandt [Fri, 27 Oct 2023 17:26:49 +0000 (19:26 +0200)] 
patch 9.0.2075: TextChangedI may not always trigger

Problem:  TextChangedI may not always trigger
Solution: trigger it in more cases: for insert/
          append/change operations, and when
          opening a new line,

fixes: #13367
closes: #13375

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2 years agopatch 9.0.2074: Completion menu may be wrong v9.0.2074
Christian Brabandt [Fri, 27 Oct 2023 17:16:26 +0000 (19:16 +0200)] 
patch 9.0.2074: Completion menu may be wrong

Problem:  Completion menu may be wrong
Solution: Check for the original direction of the completion menu,
          add more tests, make it work with 'noselect'

completion: move in right direction when  filling completion_info()

When moving through the insert completion menu and switching directions,
we need to make sure we start at the correct position in the list and
move correctly forward/backwards through it, so that we do not skip
entries and the selected item points to the correct entry in the list
of completion entries generated by the completion_info() function.

The general case is this:

1) CTRL-X CTRL-N, we will traverse the list starting from
   compl_first_match and then go forwards (using the cp->next pointer)
   through the list (skipping the very first entry, which has the
   CP_ORIGINAL_TEXT flag set (since that is the empty/non-selected entry

2) CTRL-X CTRL-P, we will traverse the list starting from
   compl_first_match (which now points to the last entry). The previous
   entry will have the CP_ORIGINAL_TEXT flag set, so we need to start
   traversing the list from the second prev pointer.

There are in fact 2 special cases after starting the completion menu
with CTRL-X:

3)  CTRL-N and then going backwards by pressing CTRL-P again.
    compl_first_match will point to the same entry as in step 1 above,
    but since compl_dir_foward() has been switched by pressing CTRL-P
    to backwards we need to pretend to be in still in case 1 and still
    traverse the list in forward direction using the cp_next pointer

4)  CTRL-P and then going forwards by pressing CTRL-N again.
    compl_first_match will point to the same entry as in step 2 above,
    but since compl_dir_foward() has been switched by pressing CTRL-N
    to forwards we need to pretend to be in still in case 2 and still
    traverse the list in backward direction using the cp_prev pointer

For the 'noselect' case however, this is slightly different again. When
going backwards, we only need to go one cp_prev pointer back. And
resting of the direction works again slightly different. So we need to
take the noselect option into account when deciding in which direction
to iterate through the list of matches.

related: #13402
related: #12971
closes: #13408

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(netrw): don't echo empty lines (#13431)
nwounkn [Fri, 27 Oct 2023 17:07:38 +0000 (22:07 +0500)] 
runtime(netrw): don't echo empty lines (#13431)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2073: typo in quickfix.c comments v9.0.2073
zeertzjq [Thu, 26 Oct 2023 21:15:44 +0000 (23:15 +0200)] 
patch 9.0.2073: typo in quickfix.c comments

Problem:  typo in quickfix.c comments
Solution: fix them

closes: #13422

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2 years agoruntime(debian): update debian related runtime files (#13423)
James McCoy [Thu, 26 Oct 2023 21:14:30 +0000 (17:14 -0400)] 
runtime(debian): update debian related runtime files (#13423)

* Update Debian runtime files

Add mantic as a supported Ubuntu release and move buster/kinetic to
unsupported.

Add syntax highlighting for deb822sources filetype.

Add debsources ftplugin to set relevant comment options.

Move common version information to shared/debversions.vim

Closes #11934

Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Signed-off-by: James McCoy <jamessan@jamessan.com>
* Add myself as codeowner for Debian-related runtime files

Signed-off-by: James McCoy <jamessan@jamessan.com>
---------

Signed-off-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2072: Vim9: no nr2str conversion in list-unpack v9.0.2072
Yegappan Lakshmanan [Thu, 26 Oct 2023 21:05:07 +0000 (23:05 +0200)] 
patch 9.0.2072: Vim9: no nr2str conversion in list-unpack

Problem:  Vim9: no nr2str conversion in list-unpack
Solution: Generate 2STRING instruction to convert dict index to string

Generate instruction to convert dict index to a string

fixes:  #13417
closes: #13424

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2 years agopatch 9.0.2071: objdump files not recognized v9.0.2071
Colin Kennedy [Thu, 26 Oct 2023 21:00:05 +0000 (23:00 +0200)] 
patch 9.0.2071: objdump files not recognized

Problem:  objdump files not recognized
Solution: detect *.objdump files, add a filetype plugin

Added the objdump file/text format

closes: #13425

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
2 years agopatch 9.0.2070: [security] disallow setting env in restricted mode v9.0.2070
Christian Brabandt [Thu, 26 Oct 2023 20:14:17 +0000 (22:14 +0200)] 
patch 9.0.2070: [security] disallow setting env in restricted mode

Problem:  [security] disallow setting env in restricted mode
Solution: Setting environment variables in restricted mode could
          potentially be used to execute shell commands. Disallow this.

restricted mode: disable allow setting of environment variables

Setting environment variables in restricted mode, may have some unwanted
consequences. So, for example by setting $GCONV_PATH in restricted mode
and then calling the iconv() function, one may be able to execute some
unwanted payload, because the `iconv_open()` function internally uses
the `$GCONV_PATH` variable to find its conversion data.

So let's disable setting environment variables, even so this is no
complete protection, since we are not clearing the existing environment.
I tried a few ways but wasn't successful :(

One could also argue to disable the iconv() function completely in
restricted mode, but who knows what other API functions can be
influenced by setting some other unrelated environment variables.
So let's leave it as it is currently.

closes: #13394
See: https://huntr.com/bounties/b0a2eda1-459c-4e36-98e6-0cc7d7faccfe/

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2069: possible to escape bracketed paste mode with Ctrl-C v9.0.2069
David Leadbeater [Thu, 26 Oct 2023 20:00:34 +0000 (22:00 +0200)] 
patch 9.0.2069: possible to escape bracketed paste mode with Ctrl-C

Problem:  possible to escape bracketed paste mode with Ctrl-C
Solution: Do not handle Ctrl-C specially when key_protocol
          is in use, makes bracketed paste mode more robust

When a key protocol is in use Ctrl-C will be sent as an escape sequence,
but a raw Ctrl-C can be sent when pasting data. Pass this through, so
that a Ctrl-C can be pasted and won't result in exiting insert mode
(where the rest of the pasted keys can cause all kind of nasty
side-effects).

Many terminals will strip control characters in paste data (and xterm
will strip ^C since version 388), but this provides some defense in
depth if users change settings like xterm's allowPasteControls.

closes: #13398

Signed-off-by: David Leadbeater <dgl@dgl.cx>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2068: [security] overflow in :history v9.0.2068
Christian Brabandt [Thu, 26 Oct 2023 19:29:32 +0000 (21:29 +0200)] 
patch 9.0.2068: [security] overflow in :history

Problem:  [security] overflow in :history
Solution: Check that value fits into int

The get_list_range() function, used to parse numbers for the :history
and :clist command internally uses long variables to store the numbers.
However function arguments are integer pointers, which can then
overflow.

Check that the return value from the vim_str2nr() function is not larger
than INT_MAX and if yes, bail out with an error. I guess nobody uses a
cmdline/clist history that needs so many entries... (famous last words).

It is only a moderate vulnerability, so impact should be low.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-q22m-h7m2-9mgm

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): clarify bracketed paste mode
Christian Brabandt [Wed, 25 Oct 2023 19:44:26 +0000 (21:44 +0200)] 
runtime(doc): clarify bracketed paste mode

related: #13398

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): missing code formatting in if_pyth.txt
Christian Brabandt [Wed, 25 Oct 2023 19:21:56 +0000 (21:21 +0200)] 
runtime(doc): missing code formatting in if_pyth.txt

fixes: #13418

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2067: xxd: coloring was disabled on Cygwin v9.0.2067
Ken Takata [Wed, 25 Oct 2023 19:17:35 +0000 (21:17 +0200)] 
patch 9.0.2067: xxd: coloring was disabled on Cygwin

Problem:  xxd: coloring was disabled on Cygwin
Solution: don't include WIN32

xxd: Fix that color was disabled on Cygwin

"windows.h" was unintentionally included on Cygwin since 9.0.1834.
This accidentally disabled coloring on Cygwin.
Stop including "windows.h" on Cygwin.

closes: #13414

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2 years agopatch 9.0.2066: xxd: corrupting files when reversing bit dumps v9.0.2066
OldWorldOrdr [Wed, 25 Oct 2023 18:57:30 +0000 (20:57 +0200)] 
patch 9.0.2066: xxd: corrupting files when reversing bit dumps

Problem:  xxd: corrupting files when reversing bit dumps
Solution: handle reversing bit dump slightly differently

fixes:  #13410
closes: #13415

Co-authored-by: OldWorldOrdr <joey.t.reinhart@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: K.Takata <kentkt@csc.jp>
Signed-off-by: tristhaus <tristhaus@yahoo.de>
2 years agopatch 9.0.2065: EXPAND flag set for filetype option v9.0.2065
Doug Kearns [Wed, 25 Oct 2023 18:54:00 +0000 (20:54 +0200)] 
patch 9.0.2065: EXPAND flag set for filetype option

Problem:  EXPAND flag set for filetype option
Solution: Remove P_EXPAND flag from the 'filetype' option

Remove P_EXPAND flag from the 'filetype' option

Problem:  P_EXPAND flag is erroneously set for 'filetype' option
Solution: Remove the P_EXPAND flag

This flag is used by string options that accept file path values.  See
:help set_env.

This appears to have been included in d5e8c92 and resulted from an
incorrect implementation of 'filetype' completion.

See #12900 for a small discussion.

related: #12900
closes: #13416

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2 years agopatch 9.0.2064: cannot use buffer-number for errorformat v9.0.2064
Yegappan Lakshmanan [Wed, 25 Oct 2023 18:50:28 +0000 (20:50 +0200)] 
patch 9.0.2064: cannot use buffer-number for errorformat

Problem:  cannot use buffer-number for errorformat
Solution: add support for parsing a buffer number using '%b' in
          'errorformat'

closes: #13419

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2 years agoruntime(doc): Fix typos in several documents (#13420)
h_east [Wed, 25 Oct 2023 13:47:05 +0000 (22:47 +0900)] 
runtime(doc): Fix typos in several documents (#13420)

* Fix typos in several documents
* Update runtime/doc/terminal.txt

Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoplease report security issues to the vim-security list
Christian Brabandt [Mon, 23 Oct 2023 17:59:22 +0000 (19:59 +0200)] 
please report security issues to the vim-security list

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2063: pacman hooks are detected as conf filetype v9.0.2063
Guido Cella [Mon, 23 Oct 2023 17:27:06 +0000 (19:27 +0200)] 
patch 9.0.2063: pacman hooks are detected as conf filetype

Problem:  pacman hooks are detected as conf filetype
Solution: make it consistent to pacman.conf and detect those
          hooks as confini

Because confini has much better syntax highlighting than conf.

For reference, I identified pacman.conf and pacman hooks as dosini in
https://github.com/vim/vim/pull/6335, then
https://github.com/vim/vim/pull/10213 changed them to conf, then
https://github.com/vim/vim/pull/10518 changed pacman.conf to confini but
forgot to change hooks.

closes: #13399

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Guido Cella <guido@guidocella.xyz>
2 years agopatch 9.0.2062: Janet files are not recognised v9.0.2062
Doug Kearns [Mon, 23 Oct 2023 17:24:05 +0000 (19:24 +0200)] 
patch 9.0.2062: Janet files are not recognised

Problem:  Janet files are not recognised
Solution: Add filename and shebang detection (without
          adding an extra filetype plugin)

Those are used by the Janet language:
http://www.janet-lang.org

closes: #13400

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2 years agopatch 9.0.2061: not able to detect xkb filetypes v9.0.2061
Guido Cella [Mon, 23 Oct 2023 17:19:46 +0000 (19:19 +0200)] 
patch 9.0.2061: not able to detect xkb filetypes

Problem:  not able to detect xkb filetypes
Solution: Detect files below /u/s/X11/xkb as xkb files (without adding
          an extra filetype)

Those files are used from the X11 xkb extension

closes: #13401

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Guido Cella <guido@guidocella.xyz>
2 years agopatch 9.0.2060: *.{gn,gni} files are not recognized v9.0.2060
Amaan Qureshi [Mon, 23 Oct 2023 17:16:14 +0000 (19:16 +0200)] 
patch 9.0.2060: *.{gn,gni} files are not recognized

Problem:  *.{gn,gni} files are not recognized
Solution: Detect some as gn filetype (without adding an extra filetype)

Those come from: https://gn.googlesource.com/gn/

closes: #13405

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2 years agoruntime(doc): small updates to the documentation for varargs
Ernie Rael [Mon, 23 Oct 2023 17:08:38 +0000 (19:08 +0200)] 
runtime(doc): small updates to the documentation for varargs

- update and correct the documentation for varargs for Vim9 and make
  sure to mention that a <list> type is required.
- mention that 3match is used the matchparen plugin before 9.0.2054
  (actually this is not correct, but before that patch, Vim used the
  hardcoded id 3)

closes: #13403
closes: #13409

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2 years agoruntime(vim): Update ftplugin - comment motions (#13412)
dkearns [Mon, 23 Oct 2023 16:16:44 +0000 (03:16 +1100)] 
runtime(vim): Update ftplugin - comment motions (#13412)

Fix the pattern used by comment-motion mappings to match the start of a
block comment.

Block-comment start lines were being ignored if the previous line
contained a double-quote character anywhere in the line.  Line comments
should only be ignored if the previous line is a full-line comment and,
therefore, part of the current block comment.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2059: outstanding exceptions may be skipped v9.0.2059
Yegappan Lakshmanan [Sat, 21 Oct 2023 09:59:42 +0000 (11:59 +0200)] 
patch 9.0.2059: outstanding exceptions may be skipped

Problem:  outstanding exceptions may be skipped
Solution: When restoring exception state, process remaining outstanding
          exceptions

closes: #13386

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2 years agopatch 9.0.2058: tests: avoid error when no swap files exist v9.0.2058
zeertzjq [Sat, 21 Oct 2023 09:50:26 +0000 (11:50 +0200)] 
patch 9.0.2058: tests: avoid error when no swap files exist

Problem:  tests: avoid error when no swap files exist
Solution: use unlet! so that no error message is reported
          in case the variable does not exists

When s:GetSwapFileList() does not find any swapfiles, it will return an
empty list []. This means, that the variable 'name' will not be
declared, cause the following unlet command to fail and causing a 1 sec
delay on running the tests.

So let's instead use the :unlet! command which simply skips reporting an
error when the variable given as parameter does not exists.

closes: #13396

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2 years agopatch 9.0.2057: Vim9: no strict type checks for funcrefs varargs v9.0.2057
Ernie Rael [Sat, 21 Oct 2023 09:45:38 +0000 (11:45 +0200)] 
patch 9.0.2057: Vim9: no strict type checks for funcrefs varargs

Problem:  Vim9: no strict type checks for funcrefs varargs
Solution: Perform strict type checking when declaring funcrefs
          with vararg declaration, add tests

closes: #13397

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2 years agomatchparen: do not use hard-coded match id (#13393)
Christian Brabandt [Sat, 21 Oct 2023 09:06:50 +0000 (11:06 +0200)] 
matchparen: do not use hard-coded match id (#13393)

* matchparen: do not use hard-coded match id

Instead of using the hard-coded match id 3, which may also be used by
other plugins, let the matchparen plugin use whatever ids are
automatically returned when calling matchaddpos().

For backwards-compatibility, keep the `:3match` call, which will still
use the hard-coded id 3 (as mentioned in :h :3match).

closes: #13381

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2056: no digraph for quadruple prime v9.0.2056
Jonathan Wright [Fri, 20 Oct 2023 10:08:09 +0000 (12:08 +0200)] 
patch 9.0.2056: no digraph for quadruple prime

Problem:  no digraph for quadruple prime
Solution: add quadruple prime digraph using 4'

closes: #13380

Signed-off-by: Jonathan Wright <quaggy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Jonathan Wright <quaggy@gmail.com>
2 years agopatch 9.0.2055: Vim9: non-consistent error messages v9.0.2055
Ernie Rael [Fri, 20 Oct 2023 09:59:00 +0000 (11:59 +0200)] 
patch 9.0.2055: Vim9: non-consistent error messages

Problem:  Vim9: non-consistent error messages
Solution: make error messages more consistent with common structure

Adjust vim9class messages to follow common pattern.
[Variable|Method] "var-or-meth-name" ... class "class-name"

closes: #13391

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2 years agopatch 9.0.2054: win32: iscygpty needs update v9.0.2054
Ken Takata [Fri, 20 Oct 2023 09:54:05 +0000 (11:54 +0200)] 
patch 9.0.2054: win32: iscygpty needs update

Problem:  win32: iscygpty needs update
Solution: Update iscygpty to the latest version, make use iswascii()
          API function

Import the latest version from https://github.com/k-takata/ptycheck.
This addresses #13332 for iscygpty()

closes: #13392

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2 years agoruntime(json5): Add new ftplugin (#13385)
dkearns [Thu, 19 Oct 2023 18:00:12 +0000 (05:00 +1100)] 
runtime(json5): Add new ftplugin (#13385)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2053: zig filetype detection test wrong v9.0.2053
Gregory Anders [Thu, 19 Oct 2023 17:57:57 +0000 (19:57 +0200)] 
patch 9.0.2053: zig filetype detection test wrong

Problem:  zig filetype detection test wrong
Solution: Remove .zir pattern, add new test for .zon pattern

closes: #13389

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2 years agopatch 9.0.2052: win32: using deprecated wsock32 api v9.0.2052
Ken Takata [Thu, 19 Oct 2023 15:22:24 +0000 (17:22 +0200)] 
patch 9.0.2052: win32: using deprecated wsock32 api

Problem:  win32: using deprecated wsock32 api
Solution: Use winsock2 (ws2_32) consistently

win32: Stop using wsock32

We have already used ws2_32 (winsock2) and already dropped support for
Windows 95 and NT4.  So, we don't need to care about wsock32.

Use ws2_32 consistently.

closes: #13383

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2 years agopatch 9.0.2051: Vim9: wrong error for non-existing object var v9.0.2051
Yegappan Lakshmanan [Thu, 19 Oct 2023 15:18:28 +0000 (17:18 +0200)] 
patch 9.0.2051: Vim9: wrong error for non-existing object var

Problem:  Vim9: wrong error for non-existing object var
Solution: mention object or class depending on whether
          the var is an object or class variable.

closes: #13384
closes: #13387

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2 years agoruntime(zig): Update Zig runtime files (#13388)
Gregory Anders [Thu, 19 Oct 2023 15:16:59 +0000 (10:16 -0500)] 
runtime(zig): Update Zig runtime files (#13388)

Update runtime files from upstream (https://github.com/zig/zig.vim) at
commit 54c216e5306a5c3878a60596aacb94dca8652ab9.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoRemove mention of huntr.dev since they do no longer support us
Christian Brabandt [Thu, 19 Oct 2023 15:12:19 +0000 (17:12 +0200)] 
Remove mention of huntr.dev since they do no longer support us

They do no longer support us, since they are shifting away to AI/ML
projects only. So remove any mentioned of using huntr.dev
https://huntr.com/new-huntr-faq/

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoPatch 9.0.2050v2: Missing change to version.c
Christian Brabandt [Thu, 19 Oct 2023 15:04:04 +0000 (17:04 +0200)] 
Patch 9.0.2050v2: Missing change to version.c

Problem:  v9.0.2050 missed the change to version.c
Solution: include the version.c change

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2050: Vim9: crash with deferred function call and exception v9.0.2050
Yegappan Lakshmanan [Thu, 19 Oct 2023 08:52:34 +0000 (10:52 +0200)] 
patch 9.0.2050: Vim9: crash with deferred function call and exception

Problem:  Vim9: crash with deferred function call and exception
Solution: Save and restore exception state

Crash when a deferred function is called after an exception and another
exception is thrown

closes: #13376
closes: #13377

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2 years agopatch 9.0.2049: Vim9: not recognizing qualified class vars for infix ops v9.0.2049
Yegappan Lakshmanan [Thu, 19 Oct 2023 08:47:53 +0000 (10:47 +0200)] 
patch 9.0.2049: Vim9: not recognizing qualified class vars for infix ops

Problem:  Vim9: not recognizing qualified class vars for infix ops
Solution: Drop the class type from the stack before generating the
          CLASSMEMBER instruction

closes: #13378
closes: #13379

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2 years agopatch 9.0.2048: python: uninitialized warning v9.0.2048
Ken Takata [Wed, 18 Oct 2023 10:02:24 +0000 (12:02 +0200)] 
patch 9.0.2048: python: uninitialized warning

Problem:  python: uninitialized warning
Solution: initialize 'minor' always

win32,py3: Fix uninitialized warning

Fix the following warning:
```
if_python3.c: In function 'py3_get_system_libname':
if_python3.c:879:16: warning: 'minor' may be used uninitialized [-Wmaybe-uninitialized]
  879 |             if (minor == PY_MINOR_VERSION)
      |                ^
if_python3.c:839:24: note: 'minor' was declared here
  839 |         long    major, minor;
      |                        ^~~~~
```

closes: #13368

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2 years agopatch 9.0.2047: perl: warning about inconsistent dll linkage v9.0.2047
Ken Takata [Wed, 18 Oct 2023 09:59:44 +0000 (11:59 +0200)] 
patch 9.0.2047: perl: warning about inconsistent dll linkage

Problem:  perl: warning about inconsistent dll linkage
Solution: suppress warning

Suppress warning C4273 (inconsistent DLL linkage).

Also adjust inconsistent use of const.

closes: #13369

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2 years agopatch 9.0.2046: win32,python: warning that MS_WIN64 got re-defined v9.0.2046
Ken Takata [Wed, 18 Oct 2023 09:53:30 +0000 (11:53 +0200)] 
patch 9.0.2046: win32,python: warning that MS_WIN64 got re-defined

Problem:  win32,python: warning that MS_WIN64 got re-defined
Solution: Do not define MS_WIN64, as it is no longer used

Suppress the following warning:
```
In file included from C:/Python312-64/include/Python.h:12,
                 from if_python3.c:79:
C:/Python312-64/include/pyconfig.h:240: warning: "MS_WIN64" redefined
  240 | #define MS_WIN64
      |
<command-line>: note: this is the location of the previous definition
```

`MS_WIN64` is not defined in `Make_mvc.mak` either.
This should be able to be safely removed.

closes: #13370

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2 years agopatch 9.0.2045: tests: checking for swap files takes time v9.0.2045
zeertzjq [Wed, 18 Oct 2023 09:50:37 +0000 (11:50 +0200)] 
patch 9.0.2045: tests: checking for swap files takes time

Problem:  tests: checking for swap files takes time
Solution: don't check for swap files  when test has been skipped

Check for swap files takes a considerable about of time, so don't do
that for skipped tests to avoid wasting time.

closes: #13371

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2 years agopatch 9.0.2044: Vim9: exceptions confuse defered functions v9.0.2044
Yegappan Lakshmanan [Wed, 18 Oct 2023 09:47:37 +0000 (11:47 +0200)] 
patch 9.0.2044: Vim9: exceptions confuse defered functions

Problem:  Vim9: exceptions confuse defered functions
Solution: save and restore exception state when calling defered
          functions

closes: #13364
closes: #13372

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2 years agoruntime(systemd): allow for overriding systemd ftplugin settings (#13373)
Enno [Wed, 18 Oct 2023 09:38:19 +0000 (11:38 +0200)] 
runtime(systemd): allow for overriding systemd ftplugin settings (#13373)

closes: #13357

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2043: Vim9: issue with funcref assignmentand varargs v9.0.2043
Ernie Rael [Tue, 17 Oct 2023 16:15:01 +0000 (18:15 +0200)] 
patch 9.0.2043: Vim9: issue with funcref assignmentand varargs

Problem:  Vim9: issue with funcref assignmentand varargs
Solution: Fix funcref type checking

closes: #13351

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2 years agopatch 9.0.2042: Test_cq_zero_exmode fails without channel feature v9.0.2042
Christian Brabandt [Tue, 17 Oct 2023 16:10:13 +0000 (18:10 +0200)] 
patch 9.0.2042: Test_cq_zero_exmode fails without channel feature

Problem:  Test_cq_zero_exmode fails without channel feature
Solution: Make the test check the channel feature

closes: #13365

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2041: trim(): hard to use default mask v9.0.2041
Illia Bobyr [Tue, 17 Oct 2023 16:00:50 +0000 (18:00 +0200)] 
patch 9.0.2041: trim(): hard to use default mask

Problem:  trim(): hard to use default mask (partly revert v9.0.2040)
Solution: use default mask when it is empty

The default 'mask' value is pretty complex, as it includes many
characters.  Yet, if one needs to specify the trimming direction, the
third argument, 'trim()' currently requires the 'mask' value to be
provided explicitly.

Currently, an empty 'mask' will make 'trim()' call return 'text' value
that is passed in unmodified.  It is unlikely that someone is using it,
so the chances of scripts being broken by this change are low.

Also, this reverts commit 9.0.2040 (which uses v:none for the default
and requires to use an empty string instead).

closes: #13358

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2 years agoruntime(json5): include syntax script for json5 (#13356)
Rolf Vidar Mazunki Hoksaas [Tue, 17 Oct 2023 09:13:06 +0000 (11:13 +0200)] 
runtime(json5): include syntax script for json5 (#13356)

Merging syntax file from gutenye/json5.vim, modified to include proper
vim header.

See: https://github.com/vim/vim/issues/8499

Signed-off-by: Mazunki Hoksaas <rolferen@gmail.com>
Co-authored-by: Guten Ye <ywzhaifei@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2040: trim(): hard to use default mask v9.0.2040
Illia Bobyr [Tue, 17 Oct 2023 09:09:45 +0000 (11:09 +0200)] 
patch 9.0.2040: trim(): hard to use default mask

Problem:  trim(): hard to use default mask
Solution: Use default 'mask' when it is v:none

The default 'mask' value is pretty complex, as it includes many
characters.  Yet, if one needs to specify the trimming direction, the
third argument, 'trim()' currently requires the 'mask' value to be
provided explicitly.

'v:none' is already used to mean "use the default argument value" in
user defined functions.  See |none-function_argument| in help.

closes: #13363

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2 years agopatch 9.0.2039: completion shows current word after completion restart v9.0.2039
nwounkn [Tue, 17 Oct 2023 09:05:38 +0000 (11:05 +0200)] 
patch 9.0.2039: completion shows current word after completion restart

Problem:  completion shows current word after completion restart
Solution: remove the word being completed after completion restart

The word being completed is shown in a completion list after completion
restart, because it isn't removed from the current buffer before
searching for matches.

Also adjust `Test_complete_add_onechar` to match the new behavior.

closes: #13349

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: nwounkn <nwounkn@gmail.com>
2 years agopatch 9.0.2038: Vim9: object method funcref not cleaned up after use v9.0.2038
Yegappan Lakshmanan [Tue, 17 Oct 2023 09:00:45 +0000 (11:00 +0200)] 
patch 9.0.2038: Vim9: object method funcref not cleaned up after use

Problem:  Vim9: object method funcref not cleaned up after use
Solution: Clean up type stack after using object method funcref,
          remove now longer used ISN_DEFEROBJ instrunction

closes: #13360

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2 years agopatch 9.0.2037: A few remaining cmdline completion issues with C-E/Y v9.0.2037
Yee Cheng Chin [Tue, 17 Oct 2023 08:56:25 +0000 (10:56 +0200)] 
patch 9.0.2037: A few remaining cmdline completion issues with C-E/Y

Problem:  A few remaining cmdline completion issues with C-E/Y
Solution: Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not
          used at the end

Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not used at the end

A few places in the cmdline completion code only works properly when the
user hits Tab (or 'wildchar') at the end of the cmdline, even though
it's supposed to work even in the middle of the line.

For fuzzy search, `:e ++ff`, and `:set hl=`, fix completion code to make
sure to use `xp_pattern_len` instead of assuming the entire `xp_pattern`
is the search pattern (since it contains texts after the cursor).

Fix Ctrl-E / Ctrl-Y to not jump to the end when canceling/accepting a
wildmenu completion. Also, make them work even when not using
`set wildoptions+=pum` as there is no drawback to doing so.
(Related issue where this was brought up: #13331)

closes: #13362

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2 years agopatch 9.0.2036: if_python: rework python3.12 build dependency v9.0.2036
Yee Cheng Chin [Tue, 17 Oct 2023 08:38:11 +0000 (10:38 +0200)] 
patch 9.0.2036: if_python: rework python3.12 build dependency

Problem:  if_python: rework python3.12 build dependency
          (after 9.0.1996)
Solution: use PyTuple_Size instead of inlining the Py_SIZE
          into the Vim code base

Use a simpler fix for Python 3.12 build issues

Python 3.12 introduced link dependencies to their `Py_SIZE()` inline
function, which #13290 fixed by copying the inline function to Vim's
Python binding code. This works but it's fragile, as a future update may
change the implementation of `Py_SIZE` and there is no way for us to
know.

The reason we need `Py_SIZE` to begin with is that we use
`PyTuple_GET_SIZE()` which calls that. Just fix it by mapping that to
(confusingly similarly named) `PyTuple_Size()`, which we already do in
the stable ABI implementation. There's a minor performance cost in that
it's not inlined and it does error checking but that's fine as we only
call this function rarely (in an error handler).

related: #13290
closes: #13359

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2 years agopatch 9.0.2035: [security] use-after-free with wildmenu v9.0.2035
Yee Cheng Chin [Tue, 17 Oct 2023 08:06:56 +0000 (10:06 +0200)] 
patch 9.0.2035: [security] use-after-free with wildmenu

Problem:  [security] use-after-free with wildmenu
Solution: properly clean up the wildmenu when exiting

Fix wildchar/wildmenu/pum memory corruption with special wildchar's

Currently, using `wildchar=<Esc>` or `wildchar=<C-\>` can lead to a
memory corruption if using wildmenu+pum, or wrong states if only using
wildmenu. This is due to the code only using one single place inside the
cmdline process loop to perform wild menu clean up (by checking
`end_wildmenu`) but there are other odd situations where the loop could
have exited and we need a post-loop clean up just to be sure. If the
clean up was not done you would have a stale popup menu referring to
invalid memory, or if not using popup menu, incorrect status line (if
`laststatus=0`).

For example, if you hit `<Esc>` two times when it's wildchar, there's a
hard-coded behavior to exit command-line as a failsafe for user, and if
you hit `<C-\><C-\><C-N>` it will also exit command-line, but the clean
up code would not have hit because of specialized `<C-\>` handling.

Fix Ctrl-E / Ctrl-Y to not cancel/accept wildmenu if they are also
used for 'wildchar'/'wildcharm'. Currently they don't behave properly,
and also have potentially memory unsafe behavior as the logic is
currently not accounting for this situation and try to do both.
(Previous patch that addressed this: #11677)

Also, correctly document Escape key behavior (double-hit it to escape)
in wildchar docs as it's previously undocumented.

In addition, block known invalid chars to be set in `wildchar` option,
such as Ctrl-C and `<CR>`. This is just to make it clear to the user
they shouldn't be set, and is not required for this bug fix.

closes: #13361

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2 years agopatch 9.0.2034: don't try to copy SMACK attribute, when none exist v9.0.2034
Christian Brabandt [Mon, 16 Oct 2023 08:17:13 +0000 (10:17 +0200)] 
patch 9.0.2034: don't try to copy SMACK attribute, when none exist

Problem:  don't try to copy SMACK attribute, when none exist
Solution: return early if SMACK extended attributes do not exist or
          if they are not supported

closes: #1711
closes: #13348

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2033: gcc overflow-warning for f_resolve v9.0.2033
Ken Takata [Mon, 16 Oct 2023 07:57:43 +0000 (09:57 +0200)] 
patch 9.0.2033: gcc overflow-warning for f_resolve

Problem:  gcc overflow-warning for f_resolve
Solution: use pointer p instead of pointer q[-1]

Suppress the following warning:
```
filepath.c: In function ‘f_resolve’:
filepath.c:2162:27: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 2162 |                     q[-1] = NUL;
```

Closes: #13352
closes: #13353

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
2 years agoruntime: Fix more typos (#13354)
Viktor Szépe [Mon, 16 Oct 2023 07:53:37 +0000 (09:53 +0200)] 
runtime: Fix more typos (#13354)

* Fix more typos

* Fix typos in ignored runtime/ directory

Signed-off-by: Christian Brabandt <cb@256bit.org>