From 0a3b9fb5c2358a38f931350e0a996d584d903ce6 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Fri, 27 Dec 2024 15:51:09 +0100 Subject: [PATCH 1/5] runtime(doc): clarify ARCH value for 32-bit in INSTALLpc.txt Signed-off-by: Christian Brabandt --- src/INSTALLpc.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt index 5854b10c5a6368..c1099295fb5a90 100644 --- a/src/INSTALLpc.txt +++ b/src/INSTALLpc.txt @@ -1,4 +1,4 @@ -INSTALLpc.txt - Installation of Vim on PC - Last Update: 2024 Dec 26 +INSTALLpc.txt - Installation of Vim on PC - Last Update: 2024 Dec 27 This file contains instructions for compiling Vim. If you already have an executable version of Vim, you don't need this. @@ -367,7 +367,7 @@ and you type: Note, ARCH is necessary if you don't have the sed command in your $PATH. Just make sure that the correct value is used with ARCH. In the example above the -value corresponds to 64-bit architecture. For 32-bit the value is x86. +value corresponds to 64-bit architecture. For 32-bit the value is "i686". After churning for a while, you will end up with 'gvim.exe' in the 'vim\src' directory. From b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721 Mon Sep 17 00:00:00 2001 From: Luca Saccarola Date: Fri, 27 Dec 2024 16:08:14 +0100 Subject: [PATCH 2/5] patch 9.1.0965: filetype: sh filetype set when detecting the use of bash Problem: filetype: sh filetype set when detecting the use of bash Solution: when bash is detected, use 'bash' filetype instead (Luca Saccarola) closes: #16309 Signed-off-by: Luca Saccarola Signed-off-by: Christian Brabandt --- runtime/autoload/dist/ft.vim | 1 + src/testdir/test_filetype.vim | 19 ++++++++++++------- src/version.c | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 0936a85ede9adf..ce7f44fa65ac8c 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -896,6 +896,7 @@ export def SetFileTypeSH(name: string, setft = true): string if exists("b:is_sh") unlet b:is_sh endif + return SetFileTypeShell("bash", setft) elseif name =~ '\' || name =~ '\' # Ubuntu links "sh" to "dash", thus it is expected to work the same way b:is_sh = 1 diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 27ced5207177ff..6b1f0fb8ea234a 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -128,6 +128,10 @@ def s:GetFilenameChecks(): dict> awk: ['file.awk', 'file.gawk'], b: ['file.mch', 'file.ref', 'file.imp'], basic: ['file.bas', 'file.bi', 'file.bm'], + bash: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', + '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', + '.bash-history', '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', + 'file.bash', 'file.bats', 'file.cygport'], bass: ['file.bass'], bc: ['file.bc'], bdf: ['file.bdf'], @@ -685,11 +689,12 @@ def s:GetFilenameChecks(): dict> services: ['/etc/services', 'any/etc/services'], setserial: ['/etc/serial.conf', 'any/etc/serial.conf'], sexplib: ['file.sexp'], - sh: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history', - '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh', - '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile', - 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', 'file.mdd', 'file.cygport', '.env', '.envrc', 'devscripts.conf', - '.devscripts', 'file.lo', 'file.la', 'file.lai'], + sh: ['/usr/share/doc/bash-completion/filter.sh', + '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', + '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile', + 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', + 'file.mdd', '.env', '.envrc', 'devscripts.conf', '.devscripts', 'file.lo', + 'file.la', 'file.lai'], sieve: ['file.siv', 'file.sieve'], sil: ['file.sil'], simula: ['file.sim'], @@ -984,11 +989,11 @@ def s:GetScriptChecks(): dict>> clojure: [['#!/path/clojure']], scala: [['#!/path/scala']], sh: [['#!/path/sh'], - ['#!/path/bash'], - ['#!/path/bash2'], ['#!/path/dash'], ['#!/path/ksh'], ['#!/path/ksh93']], + bash: [['#!/path/bash'], + ['#!/path/bash2']], csh: [['#!/path/csh']], tcsh: [['#!/path/tcsh']], zsh: [['#!/path/zsh']], diff --git a/src/version.c b/src/version.c index e1e0e36bc33e1c..622a0a1c663f98 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 */ +/**/ + 965, /**/ 964, /**/ From 6c57c30ad43f5e0d040f7d432ceb5d61fc6ab651 Mon Sep 17 00:00:00 2001 From: Konfekt Date: Fri, 27 Dec 2024 16:22:44 +0100 Subject: [PATCH 3/5] runtime(compiler): include a basic bash syntax checker compiler See @saccarosium 's suggestion at https://github.com/vim/vim/pull/16311#issuecomment-2563447885 closes: #16314 Signed-off-by: Konfekt Signed-off-by: Christian Brabandt --- runtime/compiler/bash.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 runtime/compiler/bash.vim diff --git a/runtime/compiler/bash.vim b/runtime/compiler/bash.vim new file mode 100644 index 00000000000000..cbd76ae410a62c --- /dev/null +++ b/runtime/compiler/bash.vim @@ -0,0 +1,12 @@ +" Vim compiler file +" Compiler: Bash Syntax Checker +" Maintainer: @konfekt +" Last Change: 2024 Dec 27 + +if exists("current_compiler") + finish +endif +let current_compiler = "bash" + +CompilerSet makeprg=bash\ -n +CompilerSet errorformat=%f:\ line\ %l:\ %m From b7f19a5459273d8a3ff095c1ff5f0a78a960ae6a Mon Sep 17 00:00:00 2001 From: h-east Date: Fri, 27 Dec 2024 16:25:32 +0100 Subject: [PATCH 4/5] patch 9.1.0966: Vim9: :enum command can be shortened Problem: Vim9: :enum command can be shortened Solution: prevent shortening of :enum command by adding the EX_WHOLE flag to command definition (h-east) closes: #16305 Signed-off-by: h-east Signed-off-by: Christian Brabandt --- src/ex_cmds.h | 2 +- src/testdir/test_vim9_enum.vim | 8 ++++++++ src/version.c | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ex_cmds.h b/src/ex_cmds.h index dc5da0a1e40be4..92a40f20a246a2 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -597,7 +597,7 @@ EXCMD(CMD_enew, "enew", ex_edit, EX_BANG|EX_TRLBAR, ADDR_NONE), EXCMD(CMD_enum, "enum", ex_class, - EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT, + EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_WHOLE|EX_EXPORT, ADDR_NONE), EXCMD(CMD_eval, "eval", ex_eval, EX_EXTRA|EX_NOTRLCOM|EX_EXPR_ARG|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK, diff --git a/src/testdir/test_vim9_enum.vim b/src/testdir/test_vim9_enum.vim index bc54bee3a97e63..a5fb26fcf39385 100644 --- a/src/testdir/test_vim9_enum.vim +++ b/src/testdir/test_vim9_enum.vim @@ -44,6 +44,14 @@ def Test_enum_parse() END v9.CheckSourceFailure(lines, 'E492: Not an editor command: enums Something', 2) + # The complete "enum" should be specified. + lines =<< trim END + vim9script + enu Something + endenum + END + v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: enu', 2) + # The complete "endenum" should be specified. lines =<< trim END vim9script diff --git a/src/version.c b/src/version.c index 622a0a1c663f98..8b9036538e8a0c 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 */ +/**/ + 966, /**/ 965, /**/ From 2e252474c4df5018b9819d86ebb70bf3b1b1a1af Mon Sep 17 00:00:00 2001 From: Aliaksei Budavei <0x000c70@gmail.com> Date: Fri, 27 Dec 2024 16:46:36 +0100 Subject: [PATCH 5/5] patch 9.1.0967: SpotBugs compiler setup can be further improved Problem: SpotBugs compiler can be further improved Solution: Introduce event-driven primitives for SpotBugs (Aliaksei Budavei) closes: #16258 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt --- runtime/compiler/spotbugs.vim | 4 +-- runtime/doc/quickfix.txt | 66 ++++++++++++++++++++++++++++++++++- runtime/ftplugin/java.vim | 46 +++++++++++++++++++++--- src/testdir/test_compiler.vim | 64 ++++++++++++++++++++++++++++++++- src/version.c | 2 ++ 5 files changed, 173 insertions(+), 9 deletions(-) diff --git a/runtime/compiler/spotbugs.vim b/runtime/compiler/spotbugs.vim index 10d164b6afa314..8ed45f8ee0971b 100644 --- a/runtime/compiler/spotbugs.vim +++ b/runtime/compiler/spotbugs.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Spotbugs (Java static checker; needs javac compiled classes) -" Maintainer: @konfekt and @zzzyxwvut -" Last Change: 2024 Dec 14 +" Maintainers: @konfekt and @zzzyxwvut +" Last Change: 2024 Dec 20 if exists('g:current_compiler') || bufname() !~# '\.java\=$' || wordcount().chars < 9 finish diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 1cd075f3ec8f5d..b6d79507ffa4e9 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2024 Dec 16 +*quickfix.txt* For Vim version 9.1. Last change: 2024 Dec 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1424,6 +1424,70 @@ of |:make|, and assigning its |Funcref| to the selected key. For example: \ function('GenericPostCompilerCommand'), \ } +When "PostCompilerAction" is available, "PostCompilerActionExecutor" is also +supported. Its value must be a Funcref pointing to a function that always +declares a single parameter of type string and decides whether |:execute| can +be dispatched on its argument, containing a pending post-compiler action, +after ascertaining the current status of |:cc| (or |:ll|): >vim + + function! GenericPostCompilerActionExecutor(action) abort + try + cc + catch /\vim + + function! GenericPreCompilerCommand(arguments) abort + if !exists('g:spotbugs_compilation_done') + doautocmd java_spotbugs_post User + execute 'make ' . a:arguments + " only run doautocmd when :make was synchronous + " see note below + doautocmd java_spotbugs_post ShellCmdPost " XXX: (a) + let g:spotbugs_compilation_done = 1 + else + cc + endif + endfunction + + function! GenericPreCompilerTestCommand(arguments) abort + if !exists('g:spotbugs_test_compilation_done') + doautocmd java_spotbugs_post User + execute 'make ' . a:arguments + " only run doautocmd when :make was synchronous + " see note below + doautocmd java_spotbugs_post ShellCmdPost " XXX: (b) + let g:spotbugs_test_compilation_done = 1 + else + cc + endif + endfunction + + let g:spotbugs_properties = { + \ 'compiler': 'maven', + \ 'DefaultPreCompilerCommand': + \ function('GenericPreCompilerCommand'), + \ 'DefaultPreCompilerTestCommand': + \ function('GenericPreCompilerTestCommand'), + \ 'PostCompilerActionExecutor': + \ function('GenericPostCompilerActionExecutor'), + \ } + +If a command equivalent of `:make` is capable of asynchronous execution and +consuming `ShellCmdPost` events, `:doautocmd java_spotbugs_post ShellCmdPost` +must be removed from such "*Action" (or "*Command") implementations (i.e. the +lines `(a)` and `(b)` in the listed examples) to retain a sequential order for +non-blocking execution, and any notification (see below) must be suppressed. +A `ShellCmdPost` `:autocmd` can be associated with any |:augroup| by assigning +its name to the "augroupForPostCompilerAction" key. + When default actions are not suited to a desired workflow, proceed by writing arbitrary functions yourself and matching their Funcrefs to the supported keys: "PreCompilerAction", "PreCompilerTestAction", and "PostCompilerAction". diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim index 0fa773335d4796..cfd25bce6c2410 100644 --- a/runtime/ftplugin/java.vim +++ b/runtime/ftplugin/java.vim @@ -3,7 +3,7 @@ " Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> " Former Maintainer: Dan Sharp " Repository: https://github.com/zzzyxwvut/java-vim.git -" Last Change: 2024 Dec 16 +" Last Change: 2024 Dec 25 " 2024 Jan 14 by Vim Project (browsefilter) " 2024 May 23 by Riley Bruins ('commentstring') @@ -113,7 +113,7 @@ if (!empty(get(g:, 'spotbugs_properties', {})) || endfunction " Work around ":bar"s and ":autocmd"s. - function! s:ExecuteActionOnce(cleanup_cmd, action_cmd) abort + function! JavaFileTypeExecuteActionOnce(cleanup_cmd, action_cmd) abort try execute a:cleanup_cmd finally @@ -285,7 +285,7 @@ if (!empty(get(g:, 'spotbugs_properties', {})) || for s:action in s:actions if has_key(s:action, 'once') execute printf('autocmd java_spotbugs %s ' . - \ 'call s:ExecuteActionOnce(%s, %s)', + \ 'call JavaFileTypeExecuteActionOnce(%s, %s)', \ s:action.event, \ string(printf('autocmd! java_spotbugs %s ', \ s:action.event)), @@ -297,7 +297,41 @@ if (!empty(get(g:, 'spotbugs_properties', {})) || endif endfor - unlet! s:action s:actions s:idx s:dispatcher + if s:SpotBugsHasProperty('PostCompilerActionExecutor') && + \ (s:request == 7 || s:request == 6 || + \ s:request == 5 || s:request == 4) + let s:augroup = s:SpotBugsGetProperty( + \ 'augroupForPostCompilerAction', + \ 'java_spotbugs_post') + let s:augroup = !empty(s:augroup) ? s:augroup : 'java_spotbugs_post' + + for s:candidate in ['java_spotbugs_post', s:augroup] + if !exists("#" . s:candidate) + execute printf('augroup %s | augroup END', s:candidate) + endif + endfor + + silent! autocmd! java_spotbugs_post User + + " Define a User ":autocmd" to define a once-only ShellCmdPost + " ":autocmd" that will invoke "PostCompilerActionExecutor" and let + " it decide whether to proceed with ":compiler spotbugs" etc.; and + " seek explicit synchronisation with ":doautocmd ShellCmdPost" by + " omitting "nested" for "java_spotbugs_post" and "java_spotbugs". + execute printf('autocmd java_spotbugs_post User ' . + \ 'call JavaFileTypeExecuteActionOnce(%s, %s)', + \ string(printf('autocmd! %s ShellCmdPost ', s:augroup)), + \ string(printf('autocmd %s ShellCmdPost ' . + \ 'call JavaFileTypeExecuteActionOnce(%s, %s)', + \ s:augroup, + \ string(printf('autocmd! %s ShellCmdPost ', s:augroup)), + \ string(printf('call call(%s, [%s])', + \ string(s:SpotBugsGetProperties().PostCompilerActionExecutor), + \ string(printf('compiler spotbugs | call call(%s, [])', + \ string(s:SpotBugsGetProperties().PostCompilerAction)))))))) + endif + + unlet! s:candidate s:augroup s:action s:actions s:idx s:dispatcher endif delfunction s:SpotBugsGetProperties @@ -310,9 +344,11 @@ function! JavaFileTypeCleanUp() abort setlocal suffixes< suffixesadd< formatoptions< comments< commentstring< path< includeexpr< unlet! b:browsefilter - " The concatenated removals may be misparsed as a User autocmd. + " The concatenated ":autocmd" removals may be misparsed as an ":autocmd". + " A _once-only_ ShellCmdPost ":autocmd" is always a call-site definition. silent! autocmd! java_spotbugs User silent! autocmd! java_spotbugs Syntax + silent! autocmd! java_spotbugs_post User endfunction " Undo the stuff we changed. diff --git a/src/testdir/test_compiler.vim b/src/testdir/test_compiler.vim index 14a1fa6a144853..d62a4ee3fd3540 100644 --- a/src/testdir/test_compiler.vim +++ b/src/testdir/test_compiler.vim @@ -405,12 +405,22 @@ func Test_compiler_spotbugs_properties() endfunc defer execute('delfunction g:SpotBugsPostCommand') + func! g:SpotBugsPostCompilerActionExecutor(action) abort + try + " XXX: Notify the spotbugs compiler about success or failure. + cc + catch /\