aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-23 18:12:28 +0800
committerGitHub <noreply@github.com>2022-08-23 18:12:28 +0800
commitdf4709ddf6d1ed524adae9373ecb762b9db11814 (patch)
treed65ac06e9560138c20f09d6f8269b4d9e2d29713 /runtime/syntax
parent42e9fe7d958e0ba025034c330d8e29293d828b60 (diff)
parentd459b6687704b7d1f230d0b14c0d59f87cf5f67d (diff)
downloadrneovim-df4709ddf6d1ed524adae9373ecb762b9db11814.tar.gz
rneovim-df4709ddf6d1ed524adae9373ecb762b9db11814.tar.bz2
rneovim-df4709ddf6d1ed524adae9373ecb762b9db11814.zip
Merge pull request #19905 from zeertzjq/vim-8.2.4726
vim-patch:8.2.{4726,4740,4741,4749,4841,4842}: expand('<script>')
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/synload.vim2
-rw-r--r--runtime/syntax/syntax.vim3
2 files changed, 3 insertions, 2 deletions
diff --git a/runtime/syntax/synload.vim b/runtime/syntax/synload.vim
index b88cd95103..056e38bf79 100644
--- a/runtime/syntax/synload.vim
+++ b/runtime/syntax/synload.vim
@@ -30,7 +30,7 @@ fun! s:SynSet()
unlet b:current_syntax
endif
- let s = expand("<amatch>")
+ 0verbose let s = expand("<amatch>")
if s == "ON"
" :set syntax=ON
if &filetype == ""
diff --git a/runtime/syntax/syntax.vim b/runtime/syntax/syntax.vim
index ac7dc314b9..55a2ee6d71 100644
--- a/runtime/syntax/syntax.vim
+++ b/runtime/syntax/syntax.vim
@@ -28,8 +28,9 @@ endif
" Set up the connection between FileType and Syntax autocommands.
" This makes the syntax automatically set when the file type is detected.
+" Avoid an error when 'verbose' is set and <amatch> expansion fails.
augroup syntaxset
- au! FileType * exe "set syntax=" . expand("<amatch>")
+ au! FileType * 0verbose exe "set syntax=" . expand("<amatch>")
augroup END