]> git.ipfire.org Git - thirdparty/vim.git/log
thirdparty/vim.git
2 years agopatch 9.0.2115: crash when callback function aborts because of recursiveness v9.0.2115
Christian Brabandt [Sun, 19 Nov 2023 09:52:50 +0000 (10:52 +0100)] 
patch 9.0.2115: crash when callback function aborts because of recursiveness

Problem:  crash when callback function aborts because of recursiveness
Solution: correctly initialize rettv

Initialize rettv in invoke_popup_callback()

Since v9.0.2030, call_callback may exit early when the callback recurses
too much.  This meant that call_func, which would set rettv->v_type =
VAR_UNKNOWN, was not being called.

Without rettv->v_type being explicitly set, it still contained whatever
garbage was used to initialize the stack value in invoke_popup_callback.
This would lead to possible crashes when calling clear_tv(&rettv).

Rather than rely on action at a distance, explicitly initialize rettv's
type to VAR_UNKNOWN so clear_tv can tell nothing needs to be done.

closes: #13495
closes: #13545
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2114: overflow detection not accurate when adding digits v9.0.2114
Christian Brabandt [Sun, 19 Nov 2023 09:47:21 +0000 (10:47 +0100)] 
patch 9.0.2114: overflow detection not accurate when adding digits

Problem:  overflow detection not accurate when adding digits
Solution: Use a helper function

Use a helper function to better detect overflows before adding integer
digits to a long or an integer variable respectively. Signal the
overflow to the caller function.

closes: #13539

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Michael Henry <vim@drmikehenry.com>
Signed-off-by: Ernie Rael <errael@raelity.com>
2 years agopatch 9.0.2113: Coverity warns for another overflow in shift_line() v9.0.2113
Christian Brabandt [Sun, 19 Nov 2023 09:45:24 +0000 (10:45 +0100)] 
patch 9.0.2113: Coverity warns for another overflow in shift_line()

Problem:  Coverity warns for another overflow in shift_line()
Solution: Test for INT_MAX after the if condition, cast integer values
          to (long long) before multiplying.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Michael Henry <vim@drmikehenry.com>
Signed-off-by: Ernie Rael <errael@raelity.com>
2 years agoruntime(doc): Refactor doc-Makefiles (#13519)
Restorer [Sat, 18 Nov 2023 16:12:20 +0000 (16:12 +0000)] 
runtime(doc): Refactor doc-Makefiles (#13519)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): document proper notation of gVim, document vim-security list
Christian Brabandt [Sat, 18 Nov 2023 09:10:07 +0000 (10:10 +0100)] 
runtime(doc): document proper notation of gVim, document vim-security list

Also, while at it, document the vim-security mailing list.

closes: #13429

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agotranslation(sr): Update Serbian messages translation (#13538)
Ivan Pešić [Fri, 17 Nov 2023 11:54:10 +0000 (15:54 +0400)] 
translation(sr): Update Serbian messages translation (#13538)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2112: [security]: overflow in shift_line v9.0.2112
Christian Brabandt [Tue, 14 Nov 2023 21:42:59 +0000 (22:42 +0100)] 
patch 9.0.2112: [security]: overflow in shift_line

Problem:  [security]: overflow in shift_line
Solution: allow a max indent of INT_MAX

[security]: overflow in shift_line

When shifting lines in operator pending mode and using a very large
value, we may overflow the size of integer. Fix this by using a long
variable, testing if the result would be larger than INT_MAX and if so,
indent by INT_MAX value.

Special case: We cannot use long here, since on 32bit architectures (or
on Windows?), it typically cannot take larger values than a plain int,
so we have to use long long count, decide whether the resulting
multiplication of the shiftwidth value * amount is larger than INT_MAX
and if so, we will store INT_MAX as possible larges value in the long
long count variable.

Then we can safely cast it back to int when calling the functions to set
the indent (set_indent() or change_indent()). So this should be safe.

Add a test that when using a huge value in operator pending mode for
shifting, we will shift by INT_MAX

closes: #13535

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2111: [security]: overflow in get_number v9.0.2111
Christian Brabandt [Tue, 14 Nov 2023 20:58:26 +0000 (21:58 +0100)] 
patch 9.0.2111: [security]: overflow in get_number

Problem:  [security]: overflow in get_number
Solution: Return 0 when the count gets too large

[security]: overflow in get_number

When using the z= command, we may overflow the count with values larger
than MAX_INT. So verify that we do not overflow and in case when an
overflow is detected, simply return 0

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2110: [security]: overflow in ex address parsing v9.0.2110
Christian Brabandt [Tue, 14 Nov 2023 20:33:29 +0000 (21:33 +0100)] 
patch 9.0.2110: [security]: overflow in ex address parsing

Problem:  [security]: overflow in ex address parsing
Solution: Verify that lnum is positive, before substracting from
          LONG_MAX

[security]: overflow in ex address parsing

When parsing relative ex addresses one may unintentionally cause an
overflow (because LONG_MAX - lnum will overflow for negative addresses).

So verify that lnum is actually positive before doing the overflow
check.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2109: [security]: overflow in nv_z_get_count v9.0.2109
Christian Brabandt [Tue, 14 Nov 2023 20:02:30 +0000 (21:02 +0100)] 
patch 9.0.2109: [security]: overflow in nv_z_get_count

Problem:  [security]: overflow in nv_z_get_count
Solution: break out, if count is too large

When getting the count for a normal z command, it may overflow for large
counts given. So verify, that we can safely store the result in a long.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2108: [security]: overflow with count for :s command v9.0.2108
Christian Brabandt [Tue, 14 Nov 2023 19:45:48 +0000 (20:45 +0100)] 
patch 9.0.2108: [security]: overflow with count for :s command

Problem:  [security]: overflow with count for :s command
Solution: Abort the :s command if the count is too large

If the count after the :s command is larger than what fits into a
(signed) long variable, abort with e_value_too_large.

Adds a test with INT_MAX as count and verify it correctly fails.

It seems the return value on Windows using mingw compiler wraps around,
so the initial test using :s/./b/9999999999999999999999999990 doesn't
fail there, since the count is wrapping around several times and finally
is no longer larger than 2147483647. So let's just use 2147483647 in the
test, which hopefully will always cause a failure

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2107: [security]: FPE in adjust_plines_for_skipcol v9.0.2107
Christian Brabandt [Tue, 14 Nov 2023 19:05:59 +0000 (20:05 +0100)] 
patch 9.0.2107: [security]: FPE in adjust_plines_for_skipcol

Problem:  [security]: FPE in adjust_plines_for_skipcol
Solution: don't divide by zero, return zero

Prevent a floating point exception when calculating w_skipcol (which can
happen with a small window when the number option is set and cpo+=n).

Add a test to verify

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2106: [security]: Use-after-free in win_close() v9.0.2106
Christian Brabandt [Tue, 14 Nov 2023 18:31:34 +0000 (19:31 +0100)] 
patch 9.0.2106: [security]: Use-after-free in win_close()

Problem:  [security]: Use-after-free in win_close()
Solution: Check window is valid, before accessing it

If the current window structure is no longer valid (because a previous
autocommand has already freed this window), fail and return before
attempting to set win->w_closing variable.

Add a test to trigger ASAN in CI

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(tar): comment out strange error condition check
Christian Brabandt [Tue, 14 Nov 2023 16:15:17 +0000 (17:15 +0100)] 
runtime(tar): comment out strange error condition check

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2105: skipcol not reset when topline changed v9.0.2105
Luuk van Baal [Tue, 14 Nov 2023 16:05:18 +0000 (17:05 +0100)] 
patch 9.0.2105: skipcol not reset when topline changed

Problem:  Skipcol is not reset when topline changed scrolling cursor to top
Solution: reset skipcol

closes: #13528
closes: #13532

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2104: wast filetype should be replaced by wat filetype v9.0.2104
rhysd [Tue, 14 Nov 2023 15:46:07 +0000 (16:46 +0100)] 
patch 9.0.2104: wast filetype should be replaced by wat filetype

Problem:  wast filetype should be replaced by wat filetype
Solution: start using the official wat filetype name

runtime: rename `wast` filetype to `wat` (Wasm text format)

The problem is the name of the current filetype wast. When the plugin
was initially created, the file extension for Wasm text format was not
fixed and .wast was more popular.

However, recently .wat became the official file extension for
WebAssembly text (WAT) format and .wast is now a file extension for the
unofficial WAST format, which is a superset of .wat for the convenience
to describe the Wasm specification conformance tests.

https://webassembly.js.org/docs/contrib-wat-vs-wast.html

However for now, let's keep using the `wat` filetype even for the .wast
extension, so that we at least do not lose the filetype settings and
syntax highlighting. This can be adjusted later, if it turns out to have
a separate need for.

closes: #13533

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): fix typo in pi_gzip.txt
Christian Brabandt [Tue, 14 Nov 2023 15:44:37 +0000 (16:44 +0100)] 
runtime(doc): fix typo in pi_gzip.txt

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2103: recursive callback may cause issues on some archs v9.0.2103
Christian Brabandt [Sun, 12 Nov 2023 15:59:29 +0000 (16:59 +0100)] 
patch 9.0.2103: recursive callback may cause issues on some archs

Problem:  recursive callback may cause issues on some archs
Solution: Decrease the limit drastically to 20

Recursive callback limit causes problems on some architectures

Since commit 47510f3d6598a1218958c03ed11337a43b73f48d we have a test
that causes a recursive popup callback function to be executed. However
it seems the current limit of 'maxfuncdepth' option value is still too
recursive for some 32bit architectures (e.g. 32bit ARM).

So instead of allowing a default limit of 100 (default value for
'maxfuncdepth'), let's reduce this limit to 20. I don't think there is a
use case where one would need such a high recursive callback limit and a
limit of 20 seems reasonable (although it is currently hard-coded).

closes: #13495
closes: #13502

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2102: matchparen highlight not cleared in completion mode v9.0.2102
Christian Brabandt [Sun, 12 Nov 2023 15:55:01 +0000 (16:55 +0100)] 
patch 9.0.2102: matchparen highlight not cleared in completion mode

Problem:  matchparen highlight not cleared in completion mode
Solution: Clear matchparen highlighting in completion mode

Remove hard-coded hack in insexpand.c to clear the :3match before
displaying the completion menu.

Add a test for matchparen highlighting. While at it, move all test tests
related to the matchparen plugin into a separate test file.

closes: #13493
closes: #13524

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(termdebug): improve the breakpoint sign label (#13525)
Shane-XB-Qian [Sun, 12 Nov 2023 15:53:39 +0000 (23:53 +0800)] 
runtime(termdebug): improve the breakpoint sign label (#13525)

// related #12589
// that should be the last chat (I) with Bram, r.i.p

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoImprove CONTRIBUTING.md
shane.xb.qian [Sun, 12 Nov 2023 15:45:15 +0000 (16:45 +0100)] 
Improve CONTRIBUTING.md

closes: #13521

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2101: CI: test_termdebug may still fail v9.0.2101
shane.xb.qian [Sun, 12 Nov 2023 08:42:12 +0000 (09:42 +0100)] 
patch 9.0.2101: CI: test_termdebug may still fail

Problem:  CI: test_termdebug may still fail
Solution: use term_wait() to make it more robust

closes: #13529

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): Renamed "makefile_*.mak" for Vim documentation (#13517)
Restorer [Sat, 11 Nov 2023 18:26:00 +0000 (18:26 +0000)] 
runtime(doc): Renamed "makefile_*.mak" for Vim documentation (#13517)

* Rename makefile_all.mak and makefile_mvc.mak

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(lynx): Update for Lynx 2.8.9 (#13510)
dkearns [Sat, 11 Nov 2023 18:06:56 +0000 (05:06 +1100)] 
runtime(lynx): Update for Lynx 2.8.9 (#13510)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(vim): Improve :let-heredoc syntax highlighting (#12923)
dkearns [Sat, 11 Nov 2023 18:06:01 +0000 (05:06 +1100)] 
runtime(vim): Improve :let-heredoc syntax highlighting (#12923)

"trim" and "eval" are allowed in any order and whitespace is not
required after "=<<".

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2100: CI: test_termdebug fails v9.0.2100
Christian Brabandt [Sat, 11 Nov 2023 17:59:33 +0000 (18:59 +0100)] 
patch 9.0.2100: CI: test_termdebug fails

Problem:  CI: test_termdebug fails
Solution: only test for a changed winlayout, if the window
          width actually changed

Also, include an unrelated comment (which doesn't warrant its own patch
number)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): clarify when formatoptions applies
Christian Brabandt [Sat, 11 Nov 2023 14:50:13 +0000 (15:50 +0100)] 
runtime(doc): clarify when formatoptions applies

closes: #13503

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(i3config): Update for i3 4.23 (#13522)
Ivan Grimaldi [Sat, 11 Nov 2023 12:09:26 +0000 (13:09 +0100)] 
runtime(i3config): Update for i3 4.23 (#13522)

Co-authored-by: Ivan Grimaldi <grimaldi.ivam@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2099: win32: terminal codes clear the terminal v9.0.2099
Nir Lichtman [Sat, 11 Nov 2023 10:27:41 +0000 (11:27 +0100)] 
patch 9.0.2099: win32: terminal codes clear the terminal

Problem:  Terminal control codes¹ are sent even when silent
          mode is on, causing the terminal to clear up
Solution: Block any terminal codes when silent mode is on

¹https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

fixes: #12822
closes: #13521

Signed-off-by: Nir Lichtman <nir@lichtman.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): Update usr_51.txt to be more inclusive (#13496)
ccn [Sat, 11 Nov 2023 08:35:50 +0000 (03:35 -0500)] 
runtime(doc): Update usr_51.txt to be more inclusive (#13496)

use their instead of his as the user may not be male

Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): Add missing null_<type> help tags (#13498)
dkearns [Sat, 11 Nov 2023 08:33:43 +0000 (19:33 +1100)] 
runtime(doc): Add missing null_<type> help tags (#13498)

Problem:  Not all null_<type> values have a help tag
Solution: Add missing help tags

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoCI: labeler.yml use all instead of any for doc detection (#13507)
Philip H [Sat, 11 Nov 2023 08:14:48 +0000 (09:14 +0100)] 
CI: labeler.yml use all instead of any for doc detection (#13507)

fixup: https://github.com/vim/vim/pull/13506#pullrequestreview-1722013761

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2098: No filetype support for xcompose files v9.0.2098
ObserverOfTime [Sat, 11 Nov 2023 08:12:27 +0000 (09:12 +0100)] 
patch 9.0.2098: No filetype support for xcompose files

Problem:  No filetype support for xcompose files
Solution: Add filetype detection

closes: #13508

Signed-off-by: ObserverOfTime <chronobserver@disroot.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoruntime(doc): clarify `:help inclusion` section
Ernie Rael [Sat, 11 Nov 2023 08:09:47 +0000 (09:09 +0100)] 
runtime(doc): clarify `:help inclusion` section

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agoCI: labeler.yml: Add some more component detection rules (#13511)
K.Takata [Sat, 11 Nov 2023 08:04:31 +0000 (17:04 +0900)] 
CI: labeler.yml: Add some more component detection rules (#13511)

Add rules for `installer`, `platform-mac`, `platform-windows`, `xxd`.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2 years agopatch 9.0.2097: No support for cypher files v9.0.2097
Gerrit Meier [Sat, 11 Nov 2023 07:58:26 +0000 (08:58 +0100)] 
patch 9.0.2097: No support for cypher files

Problem:  No support for cypher files
Solution: Add cypher filetype detection

Cypher query language support to work with (mostly) graph databases.

Already existing lsp support in Neovim's nvim-lspconfig:
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#cypher_ls

closes: #13516

Signed-off-by: Gerrit Meier <meistermeier@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>