1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-26 19:55:11 +01:00
Commit graph

20917 commits

Author SHA1 Message Date
John Marriott
fbe2dd7b4c
patch 9.1.1129: missing out-of-memory test in buf_write()
Problem:  missing out-of-memory test in buf_write()
Solution: Check that the returned allocated buffer is not NULL
          (John Marriott)

closes: 

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 23:17:09 +01:00
Lucas Eekhof
27f5136761
runtime(mail): add commentstring '> %s' to ftplugin
The new native commenting functionality is currently not used when
editing mail. One could reasonably expect it to change the "quote" state
of any given line in the mail (i.e. the preceding ">"), which would be
very handy and feel natural when editing mail. Especially since the
current file already uses "setlocal comments+=n:>".

Solution: Add commentstring to `> %s` to be used in files of type mail.

closes: 

Signed-off-by: Lucas Eekhof <105216949+eekhof@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:32:07 +01:00
Yegappan Lakshmanan
e3fed4828c
patch 9.1.1128: patch 9.1.1119 caused a regression with imports
Problem:  patch 9.1.1119 caused a regression with imports
          (girishji)
Solution: revert the script ID change for the class script variable for
          now (Yegappan Lakshmanan)

fixes: 
closes: 

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:20:54 +01:00
dringsim
106899eb21
runtime(dnsmasq): include simple filetype plugin
closes: 

Signed-off-by: dringsim <dringsim@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:19:23 +01:00
glepnir
52fd867f5e
patch 9.1.1127: preinsert text is not cleaned up correctly
Problem:  when 'completeopt' is set to preinsert the preinserted text is
          not cleared when adding new leader (Yee Cheng Chin)
Solution: add a condition to delete preinsert text in edit function
          (glepnir)

closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:13:24 +01:00
glepnir
4418041698
patch 9.1.1126: patch 9.1.1121 used a wrong way to handle enter
Problem:  patch 9.1.1121 used a wrong way to handle enter
Solution: compl_enter_selects also needs to consider the selected item
          in ins_compl_new_leader() (glepnir)

closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:09:48 +01:00
glepnir
3af0a8d8f5
patch 9.1.1125: cannot loop through pum menu with multiline items
Problem:  cannot loop through pum menu with multiline items with
          fuzzy and noselect in 'completeopt' (Tomasz N)
Solution: remove unnecessary compl_no_select condition (glepnir)

fixes: 
closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:06:16 +01:00
zeertzjq
08a83a033a
patch 9.1.1124: No test for 'listchars' "precedes" with double-width char
Problem:  No test for 'listchars' "precedes" with double-width char.
Solution: Add a test and fix a typo in code (zeertzjq).

closes: 

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 22:04:09 +01:00
Yee Cheng Chin
e700ddeea4
patch 9.1.1123: popup hi groups not falling back to defaults
Problem:  Highlight groups PopupSelected/PopupNotification/
          MessageWindow are supposed to fall back to default highlight
          groups if they are not defined. However, once a colorscheme
          has defined them, switching to another colorscheme that
          doesn't do so will leave behind a cleared colorscheme, which
          causes the fallback to fail.

Solution: Set up default links to the relevant fallback highlight
          groups, which makes sure a `:hi clear` command will reset the
          state properly (Yee Cheng Chin).

closes: 

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 21:58:21 +01:00
David Mandelberg
911742a975
runtime(dosini): Add support for # comments to ftplugin
runtime/syntax/dosini.vim supports both ; and # as comments, and I think
a bunch of the files detected as dosini do too, so add support for # to
the ftplugin.

closes: 

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-20 20:43:10 +01:00
John Marriott
d6e3c9048d
patch 9.1.1122: too many strlen() calls in findfile.c
Problem:  too many strlen() calls in findfile.c
Solution: refactor findfile.c and remove calls to strlen()
          (John Marriott)

closes: 

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-18 20:45:48 +01:00
glepnir
07f0dbe3aa
patch 9.1.1121: Enter does not insert newline with "noselect"
Problem:  Enter does not insert newline with "noselect" when the pum is
          visible (lifepillar)
Solution: When Enter is pressed and no complete-item is selected,
          ins_compl_prep returns false, and the edit function continues
          processing Enter to insert a new line. (glepnir)

fixes: 
closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-18 20:27:30 +01:00
Luca Saccarola
ee1a24b21d
runtime(netrw): fix s:NetrwHome() regression
If $MYVIMDIR is unset netrw creates a directory called '$MYVIMDIR' in
the current directory

fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-18 20:11:51 +01:00
Christian Brabandt
44c1c04ddb
patch 9.1.1120: tests: Test_registers fails
Problem:  tests: Test_registers fails
          (T.J. Townsend, after v9.1.1115)
Solution: require clipboard feature

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-17 22:27:45 +01:00
Christian Brabandt
5647c91355
runtime(doc): add reference to extendnew() at extend()
related: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-17 21:33:30 +01:00
Yegappan Lakshmanan
778ada48fb
patch 9.1.1119: Vim9: Not able to use an autoloaded class from another autoloaded script
Problem:  Vim9: Not able to use an autoloaded class from another
          autoloaded script (Elliot)
Solution: make it work (Yegappan Lakshmanan)

fixes: 
closes: 

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-17 20:21:23 +01:00
Christian Brabandt
b34a688ba0
patch 9.1.1118: tests: test_termcodes fails
Problem:  tests: test_termcodes fails
          (after: v9.1.1114)
Solution: adjust the test for the expected termguicolors value

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-17 20:09:11 +01:00
Doug Kearns
68ba6c2c6c
runtime(vim): Update base-syntax, improve performance
Contain the vimNotation syntax group, matching this at top level is
unnecessary and very slow.

The removed vimString and vimNumber definitions are broken and/or never
match. They have long been replaced by newer definitions.

closes: 

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:40:12 +01:00
Hirohito Higashi
5887cce1d7
patch 9.1.1117: there are a few minor style issues
Problem:  there are a few minor style issues
Solution: fix the issues (Hirohito Higashi)

closes: 

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:34:30 +01:00
Yegappan Lakshmanan
b5f463ce4f
patch 9.1.1116: Vim9: super not supported in lambda expressions
Problem:  Vim9: super not supported in lambda expressions
          (Aliaksei Budavei)
Solution: Support using the super keyword in a closure in an instance
          method (Yegappan Lakshmanan)

fixes: 
closes: 

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:25:24 +01:00
Yegappan Lakshmanan
44831e4bea
runtime(doc): Update the 'specifies' keyword documentation, slightly reformat
closes: 

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:23:07 +01:00
Christian Brabandt
c0f0e2380e
patch 9.1.1115: [security]: use-after-free in str_to_reg()
Problem:  [security]: use-after-free in str_to_reg()
          (fizz-is-on-the-way)
Solution: when redirecting the :display command, check that one
          does not output to the register being displayed

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-63p5-mwg2-787v

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 16:06:38 +01:00
Christian Brabandt
27822a0441
patch 9.1.1114: enabling termguicolors automatically confuses users
Problem:  enabling termguicolors automatically confuses users. Since
          querying the terminal for the RGB flag happens asynchronously,
          enabling termguicolors is noticeable by users as the highlighting changes
          and is therefore unexpected.
          (after v9.1.1054)
Solution: comment out that part for now. We may need another way to
          enable this in the future.

fixes: 
fixes: 
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-16 09:30:00 +01:00
Vladyslav Rehan
3f60114236
runtime(keymap): Add ukrainian-enhanced keymap
The "Ukrainian enhanced keymap" allows you to type Ukrainian in Vim
using jcuken Windows layout.

Original file is made by Ivan Korneliuk and can be found at
https://github.com/vansha/ukrainian-enhanced.vim. It is being added here
with the permission of the author.

There is another ukrainian layout already in Vim, namely the
keymap\ukrainian-jcuken.vim script by Anatoli Sakhnik. But this one
differs in way it maps numeric keys. It uses values usual for Windows
users.

closes: 

Signed-off-by: Vladyslav Rehan <rehanvladyslav@gmail.com>
Signed-off-by: Ivan Korneliuk <vansha@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-15 09:59:57 +01:00
Yee Cheng Chin
e67eff2e24
patch 9.1.1113: tests: Test_terminal_builtin_without_gui waits 2 seconds
Problem:  tests: Test_terminal_builtin_without_gui waits 2 seconds
Solution: add --not-a-term to remove the annoying 2s delay in error
          message when Vim detects that stdio are not from a terminal
          (Yee Cheng Chin)

closes: 

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-14 18:01:25 +01:00
zeertzjq
b6c900be9c
patch 9.1.1112: Inconsistencies in get_next_or_prev_match()
Problem:  Inconsistencies in get_next_or_prev_match() (after 9.1.1109).
Solution: Change "file" to "entry" or "match" in comments.  Use the same
          order of branches for PAGEUP and PAGEDOWN (zeertzjq).

closes: 

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-14 17:59:31 +01:00
glepnir
faf4112cdc
runtime(doc): document ComplMatchIns highlight for insert-completion
closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-14 17:57:52 +01:00
Luca Saccarola
73d8222b31
runtime(netrw): upstream snapshot of v177
relevant commits:
- defaults!: use 'suffixes' for 'g:netrw_sort_sequence'
- refactor: remove associated buffer when deliting a file
- refactor: s:NetrwLocalRm
- refactor: s:NetrwDelete
- refactor: s:NetrwLocalRmFile
- feat: use vim.notify on neovim
- fix: prefer v:lua instead of luaeval for vim.deprecate
- chore: remove old batteries

closes: 

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-14 17:54:22 +01:00
Hirohito Higashi
bf7c88d852
patch 9.1.1111: Vim9: variable not found in transitive import
Problem:  Vim9: variable not found in transitive import
          (lifepillar)
Solution: fix import and class extends (Hirohito Higashi)

fixes: 
related: 
closes: 

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 21:04:07 +01:00
Yee Cheng Chin
e70587dbdb
patch 9.1.1110: Vim tests are slow and flaky
Problem:  Vim tests are slow and flaky at the same time due to reliance
          on timeouts which are unreliable.
Solution: improve Vim test performance and reduce flakiness
          (Yee Cheng Chin)

A lot of Vim tests currently rely on waiting a specific amount of time
before asserting a condition. This is bad because 1) it is slow, as the
timeout is hardcoded, 2) it's unreliable as a resource-starved runner
may overshoot the timeout. Also, there are a lot of builtin sleep
commands in commonly used utilities like VerifyScreenDump and WaitFor()
which leads to a lot of unnecessary idle time.

Fix these issues by doing the following:
1. Make utilities like VerifyScreenDump and WaitFor use the lowest wait
   time possible (1 ms). This essentially turns it into a spin wait. On
   fast machines, these will finish very quickly. For existing tests
   that had an implicit reliance on the old timeouts (e.g.
   VerifyScreenDump had a 50ms wait before), fix the tests to wait that
   specific amount explicitly.
2. Fix tests that sleep or wait for long amounts of time to instead
   explicitly use a callback mechanism to be notified when a child
   terminal job has finished. This allows the test to only take as much
   time as possible instead of having to hard code an unreliable
   timeout.

With these fixes, tests should 1) completely quickly on fast machines,
and 2) on slow machines they will still run to completion albeit slowly.
Note that previoulsy both were not true. The hardcoded timeouts meant
that on fast machines the tests were mostly idling wasting time, whereas
on slow machines, the timeouts often were not generous enough to allow
them to run to completion.

closes: 

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:55:45 +01:00
glepnir
977561a719
patch 9.1.1109: cmdexpand.c hard to read
Problem:  cmdexpand.c hard to read
Solution: refactor the file slightly (glepnir)

closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:48:56 +01:00
Matt Perry
d7deeffe11
runtime(exports): include simple filetype plugin
closes: 

Signed-off-by: Matt Perry <matt@mattperry.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:45:13 +01:00
Matt Perry
407319fe89
runtime(samba): include simple filetype plugin
closes: 

Signed-off-by: Matt Perry <matt@mattperry.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:42:43 +01:00
zeertzjq
2c47ab8fcd
patch 9.1.1108: 'smoothscroll' gets stuck with 'listchars' "eol"
Problem:  'smoothscroll' gets stuck with 'listchars' "eol".
Solution: Count size of 'listchars' "eol" in line size when scrolling.
          (zeertzjq)

related: neovim/neovim#32405
closes: 

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:34:34 +01:00
glepnir
c0b7ca406b
patch 9.1.1107: cannot loop through completion menu with fuzzy
Problem:  cannot loop through completion menu with fuzzy and nosort in
          'completeopt'
          (Tomasz N)
Solution: Reset cur to zero and update compl_shown_match when
          'completeopt' contains "nosort" but not "noselect"
          (glepnir)

fixes: 
closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:27:44 +01:00
Doug Kearns
4f010c90bd
runtime(vim): Update base-syntax, always match continuation comments to EOL
closes: 

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-13 20:24:42 +01:00
Wu, Zhenyu
8f3277fbbe
runtime(nroff): set define option & add matchit config in ftplugin
closes: 

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Aman Verma <amanraoverma@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-12 20:58:57 +01:00
Doug Kearns
a9c06429ac
runtime(vim): Update base-syntax, match Vim9 boolean and null literals in parens
- Match Vim9 boolean and null literals in parenthesised expressions and
  function argument lists.
- Match read-only registers in expressions.

closes: 

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-12 20:44:17 +01:00
Christian Brabandt
88ce0c546b
patch 9.1.1106: tests: Test_log_nonexistent() causes asan failure
Problem:  tests: Test_log_nonexistent() causes asan failure
          (Hirohito Higashi)
Solution: don't run vim using system(), but run Vim in a terminal

related: 
related: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 22:58:20 +01:00
Yegappan Lakshmanan
7e89800988
patch 9.1.1105: Vim9: no support for protected new() method
Problem:  Vim9: no support for protected new() method
Solution: support the protected "_new()" object method
          (Yegappan Lakshmanan)

closes: 

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 22:07:05 +01:00
Drew Vogel
f0ed0e6f63
patch 9.1.1104: CI: using Ubuntu 22.04 Github runners
Problem:  CI: uses Ubuntu 22.04 runners
Solution: Switch to Ubuntu 24.04 runners, make a few adjustments for
          different $TMPDIR (Drew Vogel)

closes: 

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 21:36:33 +01:00
Yee Cheng Chin
5881828104
ci: syntax tests spam output
Currently syntax tests outputs all the Vim commands to the console,
which is annoying for a local developer but also makes the CI output
impossible to parse and just printing all the terminal output comes with
a performance penalty.

So let's just simply redirect all output to /dev/null similar to what
the script tests do.

This can be turned off locally for someone diagnosing issues but it
should not be the default behavior to output all terminal control
sequences to output in CI.

closes: 

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 20:16:11 +01:00
Drew Vogel
8cc725e927
patch 9.1.1103: if_perl: still some compile errors with Perl 5.38
Problem:  if_perl: still some compile errors with Perl 5.38
Solution: copy declaration of PL_memory_wrap from Perl header
          (Drew Vogel)

closes: 

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 20:06:07 +01:00
Christian Brabandt
bfc7719e48
patch 9.1.1102: tests: Test_WinScrolled_Resized_eiw() uses wrong filename
Problem:  tests: Test_WinScrolled_Resized_eiw() uses wrong filename
          (Luuk van Baal, after v9.1.1084)
Solution: Rename the filename to something more unique

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-11 20:03:10 +01:00
glepnir
40891bac5d
patch 9.1.1101: insexpand.c hard to read
Problem:  insexpand.c hard to read
Solution: refactor slightly to make it better readable
          (glepnir)

Problem:
- Complex while loops with nested conditions
- Redundant if branches
- Hard to understand and maintain

Solution:
- Restructure using while(true) with clear break conditions
- Using ternary to replace some if conditions
- Add descriptive comments for each step

closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 22:18:00 +01:00
Christian Brabandt
35e02af7bf
patch 9.1.1100: tests: Test_log_nonexistent only works on Linux
Problem:  tests: Test_log_nonexistent only works on Linux
          (after v9.1.1097)
Solution: Add CheckUnix condition

closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 22:13:43 +01:00
Doug Kearns
1aa287e048
runtime(vim): Update base-syntax, improve variable matching
- Match variables after operators, including line continuations.
- Match option variables without leading whitespace.
- Explicitly match expression subscripts.
- Match Vim9 variables in LHS of assignments and method calls.
- Match option variables (&option) with a dedicated syntax group like
  environment variables.
- Match list literals, fixes: 
- Match :{un}lockvar arguments.
- Match registers and environment variables in :let unpack lists.
- Match lambda expressions
- Match Vim9 scope blocks
- Match variables in :for subject
- Highlight user variables with Normal
- Improve this/super keyword matching, fixes: 

closes: 

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 22:00:27 +01:00
Yegappan Lakshmanan
54d7f18c38
patch 9.1.1099: Vim9: import with extends may crash
Problem:  Vim9: import with extends may crash, v9.1.1087 wasn't the
          correct way to fix it)
Solution: When using an import class, Check for a valid class member
          variable at compile time (Yegappan Lakshmanan)

related: 
closes: 

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 21:35:07 +01:00
glepnir
e3647c8bf5
patch 9.1.1098: leaking memory with completing multi lines
Problem:  leaking memory with completing multi lines
          (after v9.1.1086)
Solution: free allocated memory (glepnir)

closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 21:16:32 +01:00
Hirohito Higashi
c5654b8448
patch 9.1.1097: --log with non-existent path causes a crash
Problem:  --log with non-existent path causes a crash
          (Ekkosun)
Solution: split initialization phase and init the execution stack
          earlier (Hirohito Higashi)

fixes: 
closes: 

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-10 21:12:19 +01:00