aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-05 06:31:20 +0800
committerGitHub <noreply@github.com>2024-08-05 06:31:20 +0800
commit0c2860d9e5ec5417a94db6e3edd237578b76d418 (patch)
tree4041d6ac62dd901f477323a47dc07135764a191a
parent58406ab9f0adba6f26402d47479ca061864b2584 (diff)
parent28e2e8aa04308fbba1cdd9ec65305af95d9d1a0f (diff)
downloadrneovim-0c2860d9e5ec5417a94db6e3edd237578b76d418.tar.gz
rneovim-0c2860d9e5ec5417a94db6e3edd237578b76d418.tar.bz2
rneovim-0c2860d9e5ec5417a94db6e3edd237578b76d418.zip
Merge pull request #29979 from clason/vim-c5bdd66
vim-patch: update runtime files N/A patches for version.c: vim-patch:9.1.0658: Coverity warns about dereferencing NULL pointer.
-rw-r--r--runtime/autoload/zip.vim5
-rw-r--r--runtime/indent/lua.vim9
-rw-r--r--runtime/indent/testdir/lua.in19
-rw-r--r--runtime/indent/testdir/lua.ok19
4 files changed, 46 insertions, 6 deletions
diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim
index f77d729f03..e8973e3c80 100644
--- a/runtime/autoload/zip.vim
+++ b/runtime/autoload/zip.vim
@@ -9,6 +9,7 @@
" 2024 Jul 23 by Vim Project: fix 'x' command
" 2024 Jul 24 by Vim Project: use delete() function
" 2024 Jul 20 by Vim Project: fix opening remote zipfile
+" 2024 Aug 04 by Vim Project: escape '[' in name of file to be extracted
" License: Vim License (see vim's :help license)
" Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
@@ -218,8 +219,8 @@ fun! zip#Read(fname,mode)
else
let zipfile = substitute(a:fname,'^.\{-}zipfile://\(.\{-}\)::[^\\].*$','\1','')
let fname = substitute(a:fname,'^.\{-}zipfile://.\{-}::\([^\\].*\)$','\1','')
- let fname = substitute(fname, '[', '[[]', 'g')
endif
+ let fname = substitute(fname, '[', '[[]', 'g')
" sanity check
if !executable(substitute(g:zip_unzipcmd,'\s\+.*$','',''))
redraw!
@@ -230,7 +231,7 @@ fun! zip#Read(fname,mode)
endif
" the following code does much the same thing as
- " exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1)
+ " exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fname,1)
" but allows zipfile://... entries in quickfix lists
let temp = tempname()
let fn = expand('%:p')
diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim
index 35b08d4037..ce6cfe18cd 100644
--- a/runtime/indent/lua.vim
+++ b/runtime/indent/lua.vim
@@ -4,6 +4,7 @@
" First Author: Max Ischenko <mfi 'at' ukr.net>
" Last Change: 2017 Jun 13
" 2022 Sep 07: b:undo_indent added by Doug Kearns
+" 2024 Jul 27: by Vim project: match '(', ')' in function GetLuaIndentIntern()
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -46,12 +47,12 @@ function! GetLuaIndentIntern()
endif
" Add a 'shiftwidth' after lines that start a block:
- " 'function', 'if', 'for', 'while', 'repeat', 'else', 'elseif', '{'
+ " 'function', 'if', 'for', 'while', 'repeat', 'else', 'elseif', '{', '('
let ind = indent(prevlnum)
let prevline = getline(prevlnum)
let midx = match(prevline, '^\s*\%(if\>\|for\>\|while\>\|repeat\>\|else\>\|elseif\>\|do\>\|then\>\)')
if midx == -1
- let midx = match(prevline, '{\s*\%(--\%([^[].*\)\?\)\?$')
+ let midx = match(prevline, '\%({\|(\)\s*\%(--\%([^[].*\)\?\)\?$')
if midx == -1
let midx = match(prevline, '\<function\>\s*\%(\k\|[.:]\)\{-}\s*(')
endif
@@ -65,9 +66,9 @@ function! GetLuaIndentIntern()
endif
endif
- " Subtract a 'shiftwidth' on end, else, elseif, until and '}'
+ " Subtract a 'shiftwidth' on end, else, elseif, until, '}' and ')'
" This is the part that requires 'indentkeys'.
- let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|elseif\>\|until\>\|}\)')
+ let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|elseif\>\|until\>\|}\|)\)')
if midx != -1 && synIDattr(synID(v:lnum, midx + 1, 1), "name") != "luaComment"
let ind = ind - shiftwidth()
endif
diff --git a/runtime/indent/testdir/lua.in b/runtime/indent/testdir/lua.in
new file mode 100644
index 0000000000..c8f5d2bb8d
--- /dev/null
+++ b/runtime/indent/testdir/lua.in
@@ -0,0 +1,19 @@
+-- vim: set ft=lua sw=2 noet:
+
+-- START_INDENT
+function foo(a, b, c, d)
+ return { a, b, c, d }
+end
+
+local a = foo(
+1,
+2,
+"longxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+4
+)
+
+local b = {
+1,
+ 2,
+}
+-- END_INDENT
diff --git a/runtime/indent/testdir/lua.ok b/runtime/indent/testdir/lua.ok
new file mode 100644
index 0000000000..95f9873beb
--- /dev/null
+++ b/runtime/indent/testdir/lua.ok
@@ -0,0 +1,19 @@
+-- vim: set ft=lua sw=2 noet:
+
+-- START_INDENT
+function foo(a, b, c, d)
+ return { a, b, c, d }
+end
+
+local a = foo(
+ 1,
+ 2,
+ "longxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+ 4
+)
+
+local b = {
+ 1,
+ 2,
+}
+-- END_INDENT