aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-29 06:41:27 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-01-29 11:25:35 +0800
commitf1e51528d28488932b95ae03c810c823368835b6 (patch)
tree521e7096476c17b81c361cd4a51b49ce6676ac6c
parent15e77a56b711102fdc123e15b3f37d49bc0b1df1 (diff)
downloadrneovim-f1e51528d28488932b95ae03c810c823368835b6.tar.gz
rneovim-f1e51528d28488932b95ae03c810c823368835b6.tar.bz2
rneovim-f1e51528d28488932b95ae03c810c823368835b6.zip
vim-patch:71b6d3397649
Update runtime files https://github.com/vim/vim/commit/71b6d3397649fed68ef587aa863fcbdf5fdb057a Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--runtime/ftplugin/vim.vim13
1 files changed, 6 insertions, 7 deletions
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
index 06369e8a82..8abe337f9f 100644
--- 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