commit f1e51528d28488932b95ae03c810c823368835b6
parent 15e77a56b711102fdc123e15b3f37d49bc0b1df1
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon, 29 Jan 2024 06:41:27 +0800
vim-patch:71b6d3397649
Update runtime files
https://github.com/vim/vim/commit/71b6d3397649fed68ef587aa863fcbdf5fdb057a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat:
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
@@ -49,18 +49,17 @@ setlocal isk+=#
" Use :help to lookup the keyword under the cursor with K.
setlocal keywordprg=:help
-" if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>'
-if "\n" .. join(getline(1, 10), "\n") =~# '\n\s*vim9\%[script]\>'
- " Set 'comments' to format dashed lists in comments
- setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:#
- " Comments starts with # in Vim9 script
+" Comments starts with # in Vim9 script. We have to guess which one to use.
+if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>'
setlocal commentstring=#%s
else
- setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
- " Comments starts with a double quote in legacy script
setlocal commentstring=\"%s
endif
+" Set 'comments' to format dashed lists in comments, both in Vim9 and legacy
+" script.
+setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:#,sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
+
" Format comments to be up to 78 characters long
if &tw == 0