From a0b5bc12850f1d87fa51fb7be42df0ea835ccf21 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Fri, 2 Aug 2024 19:06:41 +0200 Subject: [PATCH 1/5] patch 9.1.0653: Patch v9.1.0648 not completely right Problem: Patch v9.1.0648 not completely right (zeertzjq) Solution: Remove always true condition closes: #15415 Signed-off-by: Christian Brabandt --- src/ex_cmds2.c | 4 +--- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 0d76b3b27aa75..0681153179e53 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -197,11 +197,9 @@ dialog_changed( // restore to empty when write failed if (empty_bufname) { - // prevent double free - if (buf->b_sfname != buf->b_ffname) - VIM_CLEAR(buf->b_sfname); buf->b_fname = NULL; VIM_CLEAR(buf->b_ffname); + VIM_CLEAR(buf->b_sfname); unchanged(buf, TRUE, FALSE); } } diff --git a/src/version.c b/src/version.c index ea418160f5dd7..b9fdfcd23302a 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 */ +/**/ + 653, /**/ 652, /**/ From b9de1a057f9a0b6de6f64a9c1b2078c7069cdd7d Mon Sep 17 00:00:00 2001 From: glepnir Date: Fri, 2 Aug 2024 19:14:38 +0200 Subject: [PATCH 2/5] patch 9.1.0654: completion does not respect completeslash with fuzzy Problem: completion does not respect completeslash with fuzzy (egesip) Solution: Change path separator on Windows, depending on 'completeslash' option value (glepnir) fixes: #15392 closes: #15418 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- src/insexpand.c | 27 +++++++++++++++++++++++++- src/testdir/test_ins_complete.vim | 32 +++++++++++++++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/src/insexpand.c b/src/insexpand.c index 3a168848fed4e..9a8d0faac7c26 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -3552,9 +3552,34 @@ get_next_filename_completion(void) size_t path_with_wildcard_len; char_u *path_with_wildcard; +#ifdef BACKSLASH_IN_FILENAME + char pathsep = (curbuf->b_p_csl[0] == 's') ? + '/' : (curbuf->b_p_csl[0] == 'b') ? '\\' : PATHSEP; +#else + char pathsep = PATHSEP; +#endif + if (in_fuzzy) { - last_sep = vim_strrchr(leader, PATHSEP); +#ifdef BACKSLASH_IN_FILENAME + if (curbuf->b_p_csl[0] == 's') + { + for (i = 0; i < leader_len; i++) + { + if (leader[i] == '\\') + leader[i] = '/'; + } + } + else if (curbuf->b_p_csl[0] == 'b') + { + for (i = 0; i < leader_len; i++) + { + if (leader[i] == '/') + leader[i] = '\\'; + } + } +#endif + last_sep = vim_strrchr(leader, pathsep); if (last_sep == NULL) { // No path separator or separator is the last character, diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index cf688ac6a6d63..becd0d8d059e9 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -2668,6 +2668,38 @@ func Test_complete_fuzzy_match() unlet g:word endfunc +func Test_complete_fuzzy_with_completeslash() + CheckMSWindows + + call writefile([''], 'fobar', 'D') + let orig_shellslash = &shellslash + set cpt& + new + set completeopt+=fuzzy + set noshellslash + + " Test with completeslash unset + set completeslash= + call setline(1, ['.\fob']) + call feedkeys("A\\\0", 'tx!') + call assert_equal('.\fobar', getline('.')) + + " Test with completeslash=backslash + set completeslash=backslash + call feedkeys("S.\\fob\\\0", 'tx!') + call assert_equal('.\fobar', getline('.')) + + " Test with completeslash=slash + set completeslash=slash + call feedkeys("S.\\fob\\\0", 'tx!') + call assert_equal('./fobar', getline('.')) + + " Reset and clean up + let &shellslash = orig_shellslash + set completeslash= + %bw! +endfunc + " Check that tie breaking is stable for completeopt+=fuzzy (which should " behave the same on different platforms). func Test_complete_fuzzy_match_tie() diff --git a/src/version.c b/src/version.c index b9fdfcd23302a..1ff7fdc6285af 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 */ +/**/ + 654, /**/ 653, /**/ From c527d90fae7210d6dc5cbdf7507f26a32455149b Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Fri, 2 Aug 2024 19:43:12 +0200 Subject: [PATCH 3/5] runtime(netrw): honor `g:netrw_alt{o,v}` for `:{S,H,V}explore` Make `:Sexplore` / `:Hexplore` / `:Vexplore` commands honor the user `&split{right,below}` settings (or netrw-specific `g:netrw_alt{o,v}`) instead of hardcoding a split direction. Similarly, update banged variants of the two latter commands to follow the inverted preference. closes: #15417 Signed-off-by: Ivan Shapovalov Signed-off-by: Christian Brabandt --- runtime/autoload/netrw.vim | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index cfa85e26faf3b..6fa99241557d2 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -19,6 +19,7 @@ " 2024 Jul 22 by Vim Project: avoid endless recursion (#15318) " 2024 Jul 23 by Vim Project: escape filename before trying to delete it (#15330) " 2024 Jul 30 by Vim Project: handle mark-copy to same target directory (#12112) +" 2024 Aug 02 by Vim Project: honor g:netrw_alt{o,v} for :{S,H,V}explore (#15417) " }}} " Former Maintainer: Charles E Campbell " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim @@ -718,7 +719,6 @@ fun! netrw#Explore(indx,dosplit,style,...) " -or- file has been modified AND file not hidden when abandoned " -or- Texplore used if a:dosplit || (&modified && &hidden == 0 && &bufhidden != "hide") || a:style == 6 -" call Decho("case dosplit=".a:dosplit." modified=".&modified." a:style=".a:style.": dosplit or file has been modified",'~'.expand("")) call s:SaveWinVars() let winsz= g:netrw_winsize if a:indx > 0 @@ -726,57 +726,41 @@ fun! netrw#Explore(indx,dosplit,style,...) endif if a:style == 0 " Explore, Sexplore -" call Decho("style=0: Explore or Sexplore",'~'.expand("")) let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz if winsz == 0|let winsz= ""|endif - exe "noswapfile ".winsz."wincmd s" -" call Decho("exe noswapfile ".winsz."wincmd s",'~'.expand("")) + exe "noswapfile ".(g:netrw_alto ? "below " : "above ").winsz."wincmd s" - elseif a:style == 1 "Explore!, Sexplore! -" call Decho("style=1: Explore! or Sexplore!",'~'.expand("")) + elseif a:style == 1 " Explore!, Sexplore! let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz if winsz == 0|let winsz= ""|endif - exe "keepalt noswapfile ".winsz."wincmd v" -" call Decho("exe keepalt noswapfile ".winsz."wincmd v",'~'.expand("")) + exe "keepalt noswapfile ".(g:netrw_altv ? "rightbelow " : "leftabove ").winsz."wincmd v" elseif a:style == 2 " Hexplore -" call Decho("style=2: Hexplore",'~'.expand("")) let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz if winsz == 0|let winsz= ""|endif - exe "keepalt noswapfile bel ".winsz."wincmd s" -" call Decho("exe keepalt noswapfile bel ".winsz."wincmd s",'~'.expand("")) + exe "keepalt noswapfile ".(g:netrw_alto ? "below " : "above ").winsz."wincmd s" elseif a:style == 3 " Hexplore! -" call Decho("style=3: Hexplore!",'~'.expand("")) let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz if winsz == 0|let winsz= ""|endif - exe "keepalt noswapfile abo ".winsz."wincmd s" -" call Decho("exe keepalt noswapfile abo ".winsz."wincmd s",'~'.expand("")) + exe "keepalt noswapfile ".(!g:netrw_alto ? "below " : "above ").winsz."wincmd s" elseif a:style == 4 " Vexplore -" call Decho("style=4: Vexplore",'~'.expand("")) let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz if winsz == 0|let winsz= ""|endif - exe "keepalt noswapfile lefta ".winsz."wincmd v" -" call Decho("exe keepalt noswapfile lefta ".winsz."wincmd v",'~'.expand("")) + exe "keepalt noswapfile ".(g:netrw_altv ? "rightbelow " : "leftabove ").winsz."wincmd v" elseif a:style == 5 " Vexplore! -" call Decho("style=5: Vexplore!",'~'.expand("")) let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz if winsz == 0|let winsz= ""|endif - exe "keepalt noswapfile rightb ".winsz."wincmd v" -" call Decho("exe keepalt noswapfile rightb ".winsz."wincmd v",'~'.expand("")) + exe "keepalt noswapfile ".(!g:netrw_altv ? "rightbelow " : "leftabove ").winsz."wincmd v" elseif a:style == 6 " Texplore call s:SaveBufVars() -" call Decho("style = 6: Texplore",'~'.expand("")) exe "keepalt tabnew ".fnameescape(curdir) -" call Decho("exe keepalt tabnew ".fnameescape(curdir),'~'.expand("")) call s:RestoreBufVars() endif call s:RestoreWinVars() -" else " Decho -" call Decho("case a:dosplit=".a:dosplit." AND modified=".&modified." AND a:style=".a:style." is not 6",'~'.expand("")) endif NetrwKeepj norm! 0 @@ -11654,7 +11638,6 @@ fun! s:StripTrailingSlash(path) return substitute(a:path, '[/\\]$', '', 'g') endfun - " --------------------------------------------------------------------- " s:NetrwBadd: adds marked files to buffer list or vice versa {{{2 " cb : bl2mf=0 add marked files to buffer list From 22a22529afc9854dffaf32c742e4796ac6c9999b Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Fri, 2 Aug 2024 19:45:52 +0200 Subject: [PATCH 4/5] CI: update clang compiler to version 20 closes: #15416 Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com> Signed-off-by: Christian Brabandt --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46eda8d7e093f..edad08a65f1ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: env: CC: ${{ matrix.compiler }} GCC_VER: 13 - CLANG_VER: 18 + CLANG_VER: 19 TEST: test SRCDIR: ./src LEAK_CFLAGS: -DEXITFREE From 0aa65b48fbe64e18a767b207802483026baecb5d Mon Sep 17 00:00:00 2001 From: Adam Monsen Date: Fri, 2 Aug 2024 19:54:15 +0200 Subject: [PATCH 5/5] patch 9.1.0655: filetype: goaccess config file not recognized Problem: filetype: goaccess config file not recognized Solution: detect 'goaccess.conf' as goaccess filetype, also include a basic syntax and ftplugin (Adam Monsen) Add syntax highlighting for GoAccess configuration file. GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser. GoAccess home page: https://goaccess.io closes: #15414 Signed-off-by: Adam Monsen Signed-off-by: Christian Brabandt --- .github/MAINTAINERS | 6 ++++-- runtime/filetype.vim | 3 +++ runtime/ftplugin/goaccess.vim | 14 ++++++++++++++ runtime/syntax/goaccess.vim | 34 ++++++++++++++++++++++++++++++++++ src/testdir/test_filetype.vim | 1 + src/version.c | 2 ++ 6 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 runtime/ftplugin/goaccess.vim create mode 100644 runtime/syntax/goaccess.vim diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index ee268f8802cba..04dd18fde2f97 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -160,11 +160,12 @@ runtime/ftplugin/gitconfig.vim @tpope runtime/ftplugin/gitignore.vim @ObserverOfTime runtime/ftplugin/gitrebase.vim @tpope runtime/ftplugin/gitsendemail.vim @tpope -runtime/ftplugin/graphql.vim @ribru17 -runtime/ftplugin/gyp.vim @ObserverOfTime runtime/ftplugin/go.vim @dbarnett +runtime/ftplugin/goaccess.vim @meonkeys runtime/ftplugin/gomod.vim @yu-yk runtime/ftplugin/gprof.vim @dpelle +runtime/ftplugin/graphql.vim @ribru17 +runtime/ftplugin/gyp.vim @ObserverOfTime runtime/ftplugin/haml.vim @tpope runtime/ftplugin/hare.vim @selenebun runtime/ftplugin/haredoc.vim @selenebun @@ -446,6 +447,7 @@ runtime/syntax/gitolite.vim @sitaramc runtime/syntax/gitrebase.vim @tpope runtime/syntax/glsl.vim @gpanders runtime/syntax/go.vim @bhcleek +runtime/syntax/goaccess.vim @meonkeys runtime/syntax/godoc.vim @dbarnett runtime/syntax/gp.vim @KBelabas runtime/syntax/gprof.vim @dpelle diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 676738078c653..220b37173eb21 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -953,6 +953,9 @@ au BufNewFile,BufRead *.go setf go au BufNewFile,BufRead Gopkg.lock setf toml au BufRead,BufNewFile go.work setf gowork +" GoAccess configuration +au BufNewFile,BufRead goaccess.conf setf goaccess + " GrADS scripts au BufNewFile,BufRead *.gs setf grads diff --git a/runtime/ftplugin/goaccess.vim b/runtime/ftplugin/goaccess.vim new file mode 100644 index 0000000000000..fb557300c97dc --- /dev/null +++ b/runtime/ftplugin/goaccess.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: GoAccess configuration +" Maintainer: Adam Monsen +" Last Change: 2024 Aug 1 + +if exists('b:did_ftplugin') + finish +endif + +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/syntax/goaccess.vim b/runtime/syntax/goaccess.vim new file mode 100644 index 0000000000000..4ca8f6d92184c --- /dev/null +++ b/runtime/syntax/goaccess.vim @@ -0,0 +1,34 @@ +" Vim syntax file +" Language: GoAccess configuration +" Maintainer: Adam Monsen +" Last Change: 2024 Aug 1 +" Remark: see https://goaccess.io/man#configuration +" +" The GoAccess configuration file syntax is line-separated settings. Settings +" are space-separated key value pairs. Comments are any line starting with a +" hash mark. +" Example: https://github.com/allinurl/goaccess/blob/master/config/goaccess.conf +" +" This syntax definition supports todo/fixme highlighting in comments, and +" special (Keyword) highlighting if a setting's value is 'true' or 'false'. +" +" TODO: a value is required, so use extreme highlighting (e.g. bright red +" background) if a setting is missing a value. + +if exists("b:current_syntax") + finish +endif + +syn match goaccessSettingName '^[a-z-]\+' nextgroup=goaccessSettingValue +syn match goaccessSettingValue '\s\+.\+$' contains=goaccessKeyword +syn match goaccessComment "^#.*$" contains=goaccessTodo,@Spell +syn keyword goaccessTodo TODO FIXME contained +syn keyword goaccessKeyword true false contained + +hi def link goaccessSettingName Type +hi def link goaccessSettingValue String +hi def link goaccessComment Comment +hi def link goaccessTodo Todo +hi def link goaccessKeyword Keyword + +let b:current_syntax = "goaccess" diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 9c2a5e8e596b3..1e6c39ed991c7 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -300,6 +300,7 @@ def s:GetFilenameChecks(): dict> gnash: ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'], gnuplot: ['file.gpi', '.gnuplot', 'file.gnuplot', '.gnuplot_history'], go: ['file.go'], + goaccess: ['goaccess.conf'], gomod: ['go.mod'], gosum: ['go.sum', 'go.work.sum'], gowork: ['go.work'], diff --git a/src/version.c b/src/version.c index 1ff7fdc6285af..a9fae005dcfc2 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 */ +/**/ + 655, /**/ 654, /**/