Skip to content

Commit 6909639

Browse files
committed
runtime(dosini): save and restore cpo value in syntax script
Commit dd0ad25 introduced line-continuation. However, to make sure this does not cause an error when Vim is run in compatible mode, we need to set compatibility mode temporarily and reset it back when finished reading the file. This fixes: https://groups.google.com/g/vim_use/c/9zccgo_RIqM/m/xlUmhBktBgAJ Signed-off-by: Christian Brabandt <[email protected]>
1 parent 75dc1ed commit 6909639

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

runtime/syntax/dosini.vim

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66
" Current Maintainer: Hong Xu <[email protected]>
77
" Homepage: http://www.vim.org/scripts/script.php?script_id=3747
88
" Repository: https://github.com/xuhdev/syntax-dosini.vim
9-
" Last Change: 2023 Jun 27
9+
" Last Change: 2023 Aug 20
1010

1111

1212
" quit when a syntax file was already loaded
1313
if exists("b:current_syntax")
1414
finish
1515
endif
1616

17+
" using of line-continuation requires cpo&vim
18+
let s:cpo_save = &cpo
19+
set cpo&vim
20+
1721
" shut case off
1822
syn case ignore
1923

@@ -39,4 +43,7 @@ hi def link dosiniValue String
3943

4044
let b:current_syntax = "dosini"
4145

46+
let &cpo = s:cpo_save
47+
unlet s:cpo_save
48+
4249
" vim: sts=2 sw=2 et

0 commit comments

Comments
 (0)