Skip to content
This repository was archived by the owner on Mar 21, 2022. It is now read-only.

Commit 8bd0939

Browse files
ELLIOTTCABLEkevinoid
authored andcommitted
(- re) Ensure Vim can undo cms/com settings
Largely lifted from vim-lua-ftplugin: https://github.com/xolox/vim-lua-ftplugin/blob/master/ftplugin/lua.vim
1 parent 2a4f464 commit 8bd0939

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ftplugin/jsonc.vim

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
runtime ftplugin/json.vim
22

3+
if exists('b:did_ftplugin_jsonc')
4+
finish
5+
else
6+
let b:did_ftplugin_jsonc = 1
7+
endif
8+
9+
" A list of commands that undo buffer local changes made below.
10+
let s:undo_ftplugin = []
11+
12+
" Set comment (formatting) related options. {{{1
313
setlocal commentstring=//%s comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
14+
call add(s:undo_ftplugin, 'commentstring< comments<')
15+
16+
" Let Vim know how to disable the plug-in.
17+
call map(s:undo_ftplugin, "'execute ' . string(v:val)")
18+
let b:undo_ftplugin = join(s:undo_ftplugin, ' | ')
19+
unlet s:undo_ftplugin

0 commit comments

Comments
 (0)