From 1678ca36c8a9c183b8ee1a50f1529c2334f6a99d Mon Sep 17 00:00:00 2001 From: Ben Scuron Date: Sun, 29 Sep 2024 09:42:24 +0200 Subject: [PATCH 01/12] runtime(doc): remove completed TODO Completed in commit: c81dfaa69ceec9f6b88caf1dcdf2f859d4fcae47 (Patch 9.0.1621) closes: #15763 Signed-off-by: Ben Scuron Signed-off-by: Christian Brabandt --- runtime/doc/todo.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 3cfe59ae70e83..530b05dd3facf 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 9.1. Last change: 2024 Jul 11 +*todo.txt* For Vim version 9.1. Last change: 2024 Sep 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -38,9 +38,6 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- -FILETYPE_FILE is defined to the same value in multiple places. -Only use the one in feature.h. Others too. - Mapping with modifier is not recognized after a partial mapping. Probably because the typeahead was simplified when looking for a matching mapping. Need to somehow undo the simplification. #12002 From 998f018df37088455bd68ad79da3d16bc4ad9bbe Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 29 Sep 2024 09:48:19 +0200 Subject: [PATCH 02/12] runtime(doc): include short form for :earlier/:later fixes: #15757 Signed-off-by: Christian Brabandt --- runtime/doc/undo.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index 40edf2fdf5b1f..7a83e776e380d 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -1,4 +1,4 @@ -*undo.txt* For Vim version 9.1. Last change: 2022 Jun 02 +*undo.txt* For Vim version 9.1. Last change: 2024 Sep 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -164,13 +164,13 @@ This is explained in the user manual: |usr_32.txt|. g- Go to older text state. With a count repeat that many times. *:ea* *:earlier* -:earlier {count} Go to older text state {count} times. -:earlier {N}s Go to older text state about {N} seconds before. -:earlier {N}m Go to older text state about {N} minutes before. -:earlier {N}h Go to older text state about {N} hours before. -:earlier {N}d Go to older text state about {N} days before. +:ea[rlier] {count} Go to older text state {count} times. +:ea[rlier] {N}s Go to older text state about {N} seconds before. +:ea[rlier] {N}m Go to older text state about {N} minutes before. +:ea[rlier] {N}h Go to older text state about {N} hours before. +:ea[rlier] {N}d Go to older text state about {N} days before. -:earlier {N}f Go to older text state {N} file writes before. +:ea[rlier] {N}f Go to older text state {N} file writes before. When changes were made since the last write ":earlier 1f" will revert the text to the state when it was written. Otherwise it will go to the write @@ -183,13 +183,13 @@ g- Go to older text state. With a count repeat that many g+ Go to newer text state. With a count repeat that many times. *:lat* *:later* -:later {count} Go to newer text state {count} times. -:later {N}s Go to newer text state about {N} seconds later. -:later {N}m Go to newer text state about {N} minutes later. -:later {N}h Go to newer text state about {N} hours later. -:later {N}d Go to newer text state about {N} days later. +:lat[er] {count} Go to newer text state {count} times. +:lat[er] {N}s Go to newer text state about {N} seconds later. +:lat[er] {N}m Go to newer text state about {N} minutes later. +:lat[er] {N}h Go to newer text state about {N} hours later. +:lat[er] {N}d Go to newer text state about {N} days later. -:later {N}f Go to newer text state {N} file writes later. +:lat[er] {N}f Go to newer text state {N} file writes later. When at the state of the last file write, ":later 1f" will go to the newest text state. From 7cd6edf2b70d070b00a92bf67c6ddc25f34d4d1b Mon Sep 17 00:00:00 2001 From: Aliaksei Budavei <0x000c70@gmail.com> Date: Sun, 29 Sep 2024 09:50:52 +0200 Subject: [PATCH 03/12] runtime(glvs): Correct the tag name of glvs-autoinstal closes: #15748 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt --- runtime/doc/pi_getscript.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/doc/pi_getscript.txt b/runtime/doc/pi_getscript.txt index 642487a498409..5f86384c652ff 100644 --- a/runtime/doc/pi_getscript.txt +++ b/runtime/doc/pi_getscript.txt @@ -1,4 +1,4 @@ -*pi_getscript.txt* For Vim version 9.1. Last change: 2024 Sep 26 +*pi_getscript.txt* For Vim version 9.1. Last change: 2024 Sep 27 > GETSCRIPT REFERENCE MANUAL by Charles E. Campbell < @@ -424,7 +424,7 @@ The AutoInstall process will: v37 Sep 23, 2024 : * Support for the new vimball's .vmb extension (old .vba extension conflicted with visual basic). - * Support for |glvs-autoinstal| in ftplugins and packages. + * Support for |glvs-autoinstall| in ftplugins and packages. * Allow platform driven customization of decompressing commands. v36 Apr 22, 2013 : * (glts) suggested use of plugin/**/*.vim instead of From 8a2aea8a623ba183dc0703a47970463b105a9399 Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Sun, 29 Sep 2024 10:03:19 +0200 Subject: [PATCH 04/12] patch 9.1.0745: filetype: bun and deno history files not recognized Problem: filetype: bun and deno history files not recognized Solution: detect '.bun_repl_history' and 'deno_history.txt' as javascript filetype (Wu, Zhenyu) closes: #15761 Signed-off-by: Wu, Zhenyu Signed-off-by: Christian Brabandt --- runtime/filetype.vim | 6 ++++++ src/testdir/test_filetype.vim | 2 +- src/version.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 85412f4df063c..1667d21799cdc 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -301,6 +301,9 @@ endif " Busted (Lua unit testing framework - configuration files) au BufNewFile,BufRead .busted setf lua +" Bun history +au BufNewFile,BufRead .bun_repl_history setf javascript + " Bundle config au BufNewFile,BufRead */.bundle/config setf yaml @@ -652,6 +655,9 @@ au BufNewFile,BufRead */etc/apt/sources.list setf debsources au BufNewFile,BufRead */etc/apt/sources.list.d/*.list setf debsources au BufNewFile,BufRead */etc/apt/sources.list.d/*.sources setf deb822sources +" Deno history +au BufNewFile,BufRead deno_history.txt setf javascript + " Deny hosts au BufNewFile,BufRead denyhosts.conf setf denyhosts diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 8977d7e3eaa5a..61272ec92456c 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -362,7 +362,7 @@ def s:GetFilenameChecks(): dict> janet: ['file.janet'], java: ['file.java', 'file.jav'], javacc: ['file.jj', 'file.jjt'], - javascript: ['file.js', 'file.jsm', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs', '.node_repl_history'], + javascript: ['file.js', 'file.jsm', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs', '.node_repl_history', '.bun_repl_history', 'deno_history.txt'], 'javascript.glimmer': ['file.gjs'], javascriptreact: ['file.jsx'], jess: ['file.clp'], diff --git a/src/version.c b/src/version.c index 7378bab803d77..cde28a3cd5a1b 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 745, /**/ 744, /**/ From c3989f184d4dd1ee817c06bb3c04d5471382dd04 Mon Sep 17 00:00:00 2001 From: hokorobi Date: Sun, 29 Sep 2024 10:08:40 +0200 Subject: [PATCH 05/12] runtime(doc): reformat ada_standard_types section closes: #15759 Signed-off-by: hokorobi Signed-off-by: Christian Brabandt --- runtime/doc/ft_ada.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/runtime/doc/ft_ada.txt b/runtime/doc/ft_ada.txt index 35dd534bb1283..983c80cdff8e1 100644 --- a/runtime/doc/ft_ada.txt +++ b/runtime/doc/ft_ada.txt @@ -1,4 +1,4 @@ -*ft_ada.txt* For Vim version 9.1. Last change: 2022 Mar 13 +*ft_ada.txt* For Vim version 9.1. Last change: 2024 Sep 29 ADA FILE TYPE PLUG-INS REFERENCE MANUAL~ @@ -48,14 +48,12 @@ ctermfg=White often shows well). There are several options you can select in this Ada mode. See |ft-ada-options| for a complete list. -To enable them, assign a value to the option. For example, to turn one on: - > - > let g:ada_standard_types = 1 -> -To disable them use ":unlet". Example: -> - > unlet g:ada_standard_types - +To enable them, assign a value to the option. For example, to turn one on: > + let g:ada_standard_types = 1 +< +To disable them use ":unlet". Example: > + unlet g:ada_standard_types +< You can just use ":" and type these into the command line to set these temporarily before loading an Ada file. You can make these option settings permanent by adding the "let" command(s), without a colon, to your "~/.vimrc" From 6db3fc5632c877062d759356c025fe06e9dc3630 Mon Sep 17 00:00:00 2001 From: hokorobi Date: Sun, 29 Sep 2024 10:10:51 +0200 Subject: [PATCH 06/12] runtime(doc): reformat gnat example closes: #15758 Signed-off-by: hokorobi Signed-off-by: Christian Brabandt --- runtime/doc/ft_ada.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/runtime/doc/ft_ada.txt b/runtime/doc/ft_ada.txt index 983c80cdff8e1..9d07afd616883 100644 --- a/runtime/doc/ft_ada.txt +++ b/runtime/doc/ft_ada.txt @@ -156,10 +156,9 @@ several versions available which differ in the licence terms used. The GNAT compiler plug-in will perform a compile on pressing and then immediately shows the result. You can set the project file to be used by -setting: - > - > call g:gnat.Set_Project_File ('my_project.gpr') - +setting: > + call g:gnat.Set_Project_File ('my_project.gpr') +< Setting a project file will also create a Vim session (|views-sessions|) so - like with the GPS - opened files, window positions etc. will be remembered separately for all projects. From fa117387eea97306e4c59043b607ccb1533f64ea Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 29 Sep 2024 10:14:32 +0200 Subject: [PATCH 07/12] patch 9.1.0746: tests: Test_halfpage_longline() fails on large terminals Problem: Test_halfpage_longline() fails on large terminals (lazypingu) Solution: Use a window with known width (zeertzjq). fixes: #15755 closes: #15756 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- src/testdir/test_normal.vim | 1 + src/version.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index adb5ce725dcba..bd830511e4926 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -4266,6 +4266,7 @@ endfunc " Test for Ctrl-D with long line func Test_halfpage_longline() 10new + 40vsplit call setline(1, ['long'->repeat(1000), 'short']) exe "norm! \" call assert_equal(2, line('.')) diff --git a/src/version.c b/src/version.c index cde28a3cd5a1b..10b0f86c1cb43 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 746, /**/ 745, /**/ From 8feed3a52548591b2eaef66f4d53e1a49b2dabe5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 29 Sep 2024 10:37:47 +0200 Subject: [PATCH 08/12] patch 9.1.0747: various typos in repo found Problem: various typos in repo found Solution: Fix typos (zeertzjq) closes: #15749 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- runtime/doc/pi_netrw.txt | 4 ++-- runtime/doc/quickfix.txt | 2 +- runtime/doc/version9.txt | 2 +- src/option.c | 2 +- src/testdir/commondumps.vim | 2 +- src/testdir/test_listdict.vim | 2 +- src/testdir/test_normal.vim | 2 +- src/version.c | 2 ++ src/window.c | 2 +- 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index a4dee26fce12f..1271bb689ba84 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -3868,7 +3868,7 @@ netrw: netrw-safe guioptions Nov 15, 2021 * removed netrw_localrm and netrw_localrmdir references - Aug 18, 2022 * (Miguel Barro) improving compatability with + Aug 18, 2022 * (Miguel Barro) improving compatibility with powershell v171: Oct 09, 2020 * included code in s:NetrwOptionsSafe() to allow |'bh'| to be set to delete when @@ -4099,7 +4099,7 @@ netrw: The "" modifier has been included with most of netrw's mappings to avoid that delay. - Jun 26, 2015 * |netrw-gn| mapping implemted + Jun 26, 2015 * |netrw-gn| mapping implemented * :Ntree NotADir resulted in having the tree listing expand in the error messages window. Fixed. diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index ea5f01d25ecfb..dc05166924bfb 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1349,7 +1349,7 @@ make, say :make html or :make pdf. Additional arguments can be passed to groff by setting them in `b:groff_compiler_args` or `g:groff_compiler_args`. The `language` argument passed to groff is set using 'spelllang'; it can be overridden by setting -`b:groff_compiler_lang`. The default enconding is `UTF-8` and can be changed +`b:groff_compiler_lang`. The default encoding is `UTF-8` and can be changed by setting `b:groff_compiler_encoding` or `g:groff_compiler_encoding`. PANDOC *quickfix-pandoc* *compiler-pandoc* diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index 94e662d6d7bc0..147f34526218e 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -41620,7 +41620,7 @@ Functions: ~ Autocommands: ~ -|CursorMovedC| after the cursor was moved in the comamnd-line +|CursorMovedC| after the cursor was moved in the command-line |KeyInputPre| before processing any key event in any mode |SessionWritePost| after writing the session file |:mksession| |TermResponseAll| after the terminal response to |t_RV| and others is diff --git a/src/option.c b/src/option.c index 4ee8d251db207..ee9502a2ed19a 100644 --- a/src/option.c +++ b/src/option.c @@ -186,7 +186,7 @@ set_init_default_backupskip(void) item = alloc(itemsize); if (item != NULL) { - // add a preceeding comma as a separator after the first item + // add a preceding comma as a separator after the first item size_t itemseplen = (ga.ga_len == 0) ? 0 : 1; size_t itemlen; diff --git a/src/testdir/commondumps.vim b/src/testdir/commondumps.vim index ed70280e2c282..cfe426cbde084 100644 --- a/src/testdir/commondumps.vim +++ b/src/testdir/commondumps.vim @@ -23,7 +23,7 @@ enddef # Search for the "failed" directory in the passed _subtreedirname_ directories # (usually "\" or "\") and, if found, select its passed _count_ -# occurence, add all its "*.dump" files to the argument list and list them; +# occurrence, add all its "*.dump" files to the argument list and list them; # also define a BufRead autocommand that would invoke "Render()" for every # "*.dump" file. def g:Init(subtreedirname: string, count: number) diff --git a/src/testdir/test_listdict.vim b/src/testdir/test_listdict.vim index 48217cf33eff5..f3bdcd4bd1ab8 100644 --- a/src/testdir/test_listdict.vim +++ b/src/testdir/test_listdict.vim @@ -1621,7 +1621,7 @@ endfunc " Test for using id() def Test_id_with_dict() - # demonstate a way that "id(item)" differs from "string(item)" + # demonstrate a way that "id(item)" differs from "string(item)" var d1 = {one: 1} var d2 = {one: 1} var d3 = {one: 1} diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index bd830511e4926..32050ced96822 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -4274,7 +4274,7 @@ func Test_halfpage_longline() endfunc " Test for Ctrl-E with long line and very narrow window, -" used to cause an inifite loop +" used to cause an infinite loop func Test_scroll_longline_no_loop() 4vnew setl smoothscroll number showbreak=> scrolloff=2 diff --git a/src/version.c b/src/version.c index 10b0f86c1cb43..80e7033592608 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 747, /**/ 746, /**/ diff --git a/src/window.c b/src/window.c index b2c90c7d64114..db907f8a482ba 100644 --- a/src/window.c +++ b/src/window.c @@ -4609,7 +4609,7 @@ free_tabpage(tabpage_T *tp) * Otherwise put it just before tab page "after". * * Does not trigger WinNewPre, since the window structures - * are not completly setup yet and could cause dereferencing + * are not completely setup yet and could cause dereferencing * NULL pointers * * Return FAIL or OK. From 9142136161560a22390de3716044cb21aa57262e Mon Sep 17 00:00:00 2001 From: Konfekt Date: Sun, 29 Sep 2024 10:46:41 +0200 Subject: [PATCH 09/12] runtime(comment): add gC mapping to (un)comment rest of line fixes: #15727 closes: #15737 Signed-off-by: Konfekt Signed-off-by: Christian Brabandt --- .../dist/opt/comment/autoload/comment.vim | 16 ++++++++++++- runtime/pack/dist/opt/comment/doc/comment.txt | 23 +++++++++++++------ runtime/pack/dist/opt/comment/doc/tags | 2 -- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/runtime/pack/dist/opt/comment/autoload/comment.vim b/runtime/pack/dist/opt/comment/autoload/comment.vim index 9dda266ffaf4d..ed3534b84d4f0 100644 --- a/runtime/pack/dist/opt/comment/autoload/comment.vim +++ b/runtime/pack/dist/opt/comment/autoload/comment.vim @@ -1,7 +1,7 @@ vim9script # Maintainer: Maxim Kim -# Last Update: 2024-04-26 +# Last Update: 2024-09-24 # # Toggle comments # Usage: @@ -10,6 +10,7 @@ vim9script # nnoremap gc comment.Toggle() # xnoremap gc comment.Toggle() # nnoremap gcc comment.Toggle() .. '_' +# nnoremap gC comment.Toggle() .. '$' export def Toggle(...args: list): string if len(args) == 0 &opfunc = matchstr(expand(''), '[^. ]*\ze[') @@ -19,6 +20,19 @@ export def Toggle(...args: list): string var cms = substitute(substitute(&cms, '\S\zs%s\s*', ' %s', ''), '%s\ze\S', '%s ', '') var [lnum1, lnum2] = [line("'["), line("']")] var cms_l = split(escape(cms, '*.'), '\s*%s\s*') + + var first_col = indent(lnum1) + var start_col = getpos("'[")[2] + if len(cms_l) == 1 && lnum1 == lnum2 && first_col < start_col + var line_start = getline(lnum1)[0 : max(0, start_col - 2)] + var line_end = getline(lnum1)[start_col - 1 : -1] + line_end = line_end =~# $'^\s*{cms_l[0]}' ? + \ substitute(line_end, $'^\s*\zs{cms_l[0]}', '', '') : + \ printf(substitute(cms, '%s\@!', '%%', 'g'), line_end) + setline(lnum1, line_start .. line_end) + return '' + endif + if len(cms_l) == 0 | return '' | endif if len(cms_l) == 1 | call add(cms_l, '') | endif var comment = 0 diff --git a/runtime/pack/dist/opt/comment/doc/comment.txt b/runtime/pack/dist/opt/comment/doc/comment.txt index 25bd067564bdf..4d791e56cbdb0 100644 --- a/runtime/pack/dist/opt/comment/doc/comment.txt +++ b/runtime/pack/dist/opt/comment/doc/comment.txt @@ -1,4 +1,4 @@ -*comment.txt* For Vim version 9.1. Last change: 2024 Jun 04 +*comment.txt* For Vim version 9.1. Last change: 2024 Sep 29 VIM REFERENCE MANUAL @@ -12,17 +12,26 @@ See |comment-install| on how to activate this package. The comment.vim package, allows to toggle comments for a single line, a range of lines or a selected text object. It defines the following mappings: - *gcc* -gcc to comment/uncomment current line *o_gc* gc{motion} to toggle comments for the selected motion - *gcip* -gcip to comment/uncomment current paragraph - *gcG* -gcG to comment/uncomment from current line till the end of a buffer *v_gc* {Visual}gc to comment/uncomment the highlighted lines. +Since gc operates on a motion, it can be used with any motion, for example _ +to comment the current line, or ip to comment the current paragraph. +A default mapping `gcc` to `gc_` is defined: + *gcc* +gcc to comment/uncomment current line + +To comment the rest of the line by `gC` whenever the filetype plugin +supports it (that is, whenever the comment marker precedes the code) and fall +back to `gcc` otherwise, add the following mapping to your vimrc: > + + nnoremap gC comment.Toggle() .. '$' +< +Note: using `gC` may not always result in valid comment markers depending on +the language used. + This plugin uses the buffer-local 'commentstring' option value to add or remove comment markers to the selected lines. Whether it will comment or un-comment depends on the first line of the range of lines to act upon. When it matches diff --git a/runtime/pack/dist/opt/comment/doc/tags b/runtime/pack/dist/opt/comment/doc/tags index ec3569e937577..ffe4177ccbb3f 100644 --- a/runtime/pack/dist/opt/comment/doc/tags +++ b/runtime/pack/dist/opt/comment/doc/tags @@ -1,8 +1,6 @@ b:comment_first_col comment.txt /*b:comment_first_col* comment.txt comment.txt /*comment.txt* g:comment_first_col comment.txt /*g:comment_first_col* -gcG comment.txt /*gcG* gcc comment.txt /*gcc* -gcip comment.txt /*gcip* o_gc comment.txt /*o_gc* v_gc comment.txt /*v_gc* From ee20fc8062b43eb8e52014978ed8f200158a7efd Mon Sep 17 00:00:00 2001 From: John M Devin Date: Sun, 29 Sep 2024 11:18:42 +0200 Subject: [PATCH 10/12] runtime(indent): allow matching negative numbers for gnu indent config file Some gnu indent options take negative numbers (e.g. --indent-label). Add matching for an optional single '-' before the number. closes: #15754 Signed-off-by: John M Devin Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/syntax/indent.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/syntax/indent.vim b/runtime/syntax/indent.vim index b2a1a0c85f400..921a0a8ad0383 100644 --- a/runtime/syntax/indent.vim +++ b/runtime/syntax/indent.vim @@ -2,7 +2,7 @@ " Language: indent(1) configuration file " Maintainer: Doug Kearns " Previous Maintainer: Nikolai Weibull -" Last Change: 2021 Nov 17 +" Last Change: 2024 Sep 29 " indent_is_bsd: If exists, will change somewhat to match BSD implementation " " TODO: is the deny-all (a la lilo.vim nice or no?)... @@ -34,7 +34,7 @@ endif syn match indentOptions '-\%(bli\|c\%([bl]i\|[dip]\)\=\|di\=\|ip\=\|lc\=\|pp\=i\|sbi\|ts\|-\%(brace-indent\|comment-indentation\|case-brace-indentation\|declaration-comment-column\|continuation-indentation\|case-indentation\|else-endif-column\|line-comments-indentation\|declaration-indentation\|indent-level\|parameter-indentation\|line-length\|comment-line-length\|paren-indentation\|preprocessor-indentation\|struct-brace-indentation\|tab-size\)\)' \ nextgroup=indentNumber skipwhite skipempty -syn match indentNumber display contained '\d\+\>' +syn match indentNumber display contained '-\=\d\+\>' syn match indentOptions '-T' \ nextgroup=indentIdent skipwhite skipempty From ea84202372061be9b5a9d16b360d5a17d93ccf7e Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 29 Sep 2024 17:17:41 +0200 Subject: [PATCH 11/12] patch 9.1.0748: :keep* commmands are sometimes misidentified as :k Problem: The :keep{alt,jumps,marks,patterns} commmands are sometimes misidentified as :k. Solution: Make sure one_letter_cmd() only returns true for :k and not other :keep* commands (Doug Kearns). This currently manifests as missing completion for :keep* commands and incorrect results from fullcommand(). E.g., fullcommand("keepmarks") returns "k" rather than "keepmarks". The correct command, however, is executed as command modifiers are handled specially in do_one_cmd() rather than using find_ex_command(). Fix exists(':k') so that it returns 2 for a full match. closes: #15742 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- src/ex_docmd.c | 9 +++++++-- src/testdir/test_cmdline.vim | 6 +++++- src/testdir/test_cmdmods.vim | 38 ++++++++++++++++++++++++++++++++++++ src/testdir/test_exists.vim | 7 +++++++ src/version.c | 2 ++ 5 files changed, 59 insertions(+), 3 deletions(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index a24b4efbce8b3..32cd7c5605635 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3584,7 +3584,9 @@ skip_option_env_lead(char_u *start) /* * Return TRUE and set "*idx" if "p" points to a one letter command. * If not in Vim9 script: - * - The 'k' command can directly be followed by any character. + * - The 'k' command can directly be followed by any character + * but :keepa[lt] is another command, as are :keepj[umps], + * :kee[pmarks] and :keepp[atterns]. * - The 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r' * but :sre[wind] is another command, as are :scr[iptnames], * :scs[cope], :sim[alt], :sig[ns] and :sil[ent]. @@ -3594,7 +3596,8 @@ one_letter_cmd(char_u *p, cmdidx_T *idx) { if (in_vim9script()) return FALSE; - if (*p == 'k') + if (p[0] == 'k' + && (p[1] != 'e' || (p[1] == 'e' && p[2] != 'e'))) { *idx = CMD_k; return TRUE; @@ -3880,6 +3883,8 @@ find_ex_command( if (one_letter_cmd(p, &eap->cmdidx)) { ++p; + if (full != NULL) + *full = TRUE; } else { diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 708f211c6990a..4fec1c1c86d53 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -1195,6 +1195,10 @@ func Test_cmdline_complete_various() call feedkeys(":ka\\\"\", 'xt') call assert_equal("\"ka\", @:) + " completion for :keepmarks command + call feedkeys(":kee edi\\\"\", 'xt') + call assert_equal("\"kee edit", @:) + " completion for short version of the :s command call feedkeys(":sI \\\"\", 'xt') call assert_equal("\"sI \", @:) @@ -3901,7 +3905,7 @@ func Test_ex_command_completion() let list = filter(getcompletion('', 'command'), 'exists(":" . v:val) == 0') " :++ and :-- are only valid in Vim9 Script context, so they can be ignored call assert_equal(['++', '--'], sort(list)) - call assert_equal(1, exists(':k')) + call assert_equal(2, exists(':k')) call assert_equal(0, exists(':ke')) call assert_equal(1, exists(':kee')) call assert_equal(1, exists(':keep')) diff --git a/src/testdir/test_cmdmods.vim b/src/testdir/test_cmdmods.vim index 66ff6a1fa8a0d..a9117e1534992 100644 --- a/src/testdir/test_cmdmods.vim +++ b/src/testdir/test_cmdmods.vim @@ -40,6 +40,44 @@ def Test_cmdmods_array() bwipe! enddef +def Test_keep_cmdmods_names() + # :k only available in legacy script + legacy call assert_equal('k', fullcommand(':k')) + legacy call assert_equal('k', fullcommand(':ke')) + # single character commands not supported in Vim9 + assert_equal('', fullcommand(':k')) + assert_equal('keepmarks', fullcommand(':ke')) + assert_equal('keepmarks', fullcommand(':kee')) + assert_equal('keepmarks', fullcommand(':keep')) + assert_equal('keepmarks', fullcommand(':keepm')) + assert_equal('keepmarks', fullcommand(':keepma')) + assert_equal('keepmarks', fullcommand(':keepmar')) + assert_equal('keepmarks', fullcommand(':keepmark')) + assert_equal('keepmarks', fullcommand(':keepmarks')) + assert_equal('keepalt', fullcommand(':keepa')) + assert_equal('keepalt', fullcommand(':keepal')) + assert_equal('keepalt', fullcommand(':keepalt')) + assert_equal('keepjumps', fullcommand(':keepj')) + assert_equal('keepjumps', fullcommand(':keepju')) + assert_equal('keepjumps', fullcommand(':keepjum')) + assert_equal('keepjumps', fullcommand(':keepjump')) + assert_equal('keepjumps', fullcommand(':keepjumps')) + assert_equal('keeppatterns', fullcommand(':keepp')) + assert_equal('keeppatterns', fullcommand(':keeppa')) + assert_equal('keeppatterns', fullcommand(':keeppat')) + assert_equal('keeppatterns', fullcommand(':keeppatt')) + assert_equal('keeppatterns', fullcommand(':keeppatte')) + assert_equal('keeppatterns', fullcommand(':keeppatter')) + assert_equal('keeppatterns', fullcommand(':keeppattern')) + assert_equal('keeppatterns', fullcommand(':keeppatterns')) +enddef + +def Test_cmdmod_completion() + assert_equal('edit', getcompletion('keepalt ed', 'cmdline')[0]) + assert_equal('edit', getcompletion('keepjumps ed', 'cmdline')[0]) + assert_equal('edit', getcompletion('keepmarks ed', 'cmdline')[0]) + assert_equal('edit', getcompletion('keeppatterns ed', 'cmdline')[0]) +enddef " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_exists.vim b/src/testdir/test_exists.vim index 9cdb3fb5c0b33..404b15c0d3784 100644 --- a/src/testdir/test_exists.vim +++ b/src/testdir/test_exists.vim @@ -113,6 +113,13 @@ func Test_exists() " Internal command with a count call assert_equal(0, exists(':3buffer')) + " Valid internal command (full match) + call assert_equal(2, exists(':k')) + " Non-existing internal command (':k' with arg 'e') + call assert_equal(0, exists(':ke')) + " Valid internal command (partial match) + call assert_equal(1, exists(':kee')) + " User defined command (full match) command! MyCmd :echo 'My command' call assert_equal(2, exists(':MyCmd')) diff --git a/src/version.c b/src/version.c index 80e7033592608..fd67af63802ca 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 748, /**/ 747, /**/ From 5dd4ec0089f0f4ef06571575ea21c0650a969ff5 Mon Sep 17 00:00:00 2001 From: Aliaksei Budavei <0x000c70@gmail.com> Date: Sun, 29 Sep 2024 17:29:39 +0200 Subject: [PATCH 12/12] CI: uploading failed screendump tests does not work Cirrus Problem: CI: uploading failed screendump tests does not work Cirrus (after: e019f3626d51f3f71) Solution: Do not use the $CIRRUS_WORKING_DIR env variable related: #15695 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 6b28b0655d3ea..3475c3fb7c1c3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -25,6 +25,6 @@ freebsd_task: screendump_artifacts: name: "Cirrus-CI-freebsd-failed-tests" path: | - "$CIRRUS_WORKING_DIR/runtime/syntax/testdir/failed/*" - "$CIRRUS_WORKING_DIR/src/testdir/failed/*" + "runtime/syntax/testdir/failed/*" + "src/testdir/failed/*" type: application/octet-stream