mirror of
https://github.com/Raimondi/delimitMate.git
synced 2026-05-25 01:38:45 +08:00
Consider that double quotes start comments in viml
This commit is contained in:
@@ -27,6 +27,7 @@ let s:exprs = []
|
|||||||
call add(s:exprs, 'prev_char =~# "\\w"')
|
call add(s:exprs, 'prev_char =~# "\\w"')
|
||||||
call add(s:exprs, 'prev_char =~# "[^[:space:][:punct]".escape(join(options.quotes, ""), "\\^[]")."]"')
|
call add(s:exprs, 'prev_char =~# "[^[:space:][:punct]".escape(join(options.quotes, ""), "\\^[]")."]"')
|
||||||
call add(s:exprs, 'next_char =~# "\\w"')
|
call add(s:exprs, 'next_char =~# "\\w"')
|
||||||
|
call add(s:exprs, 'char == "\"" && &filetype =~? "\\<vim\\>" && line =~ "^\\s*$"')
|
||||||
call add(s:exprs, 'next_char =~# "[^[:space:][:punct]".escape(join(options.quotes, ""), "\\^[]")."]"')
|
call add(s:exprs, 'next_char =~# "[^[:space:][:punct]".escape(join(options.quotes, ""), "\\^[]")."]"')
|
||||||
" Balance quotes
|
" Balance quotes
|
||||||
call add(s:exprs, 'strchars(substitute(substitute(a:info.cur.text, "\\\\.", "", "g"), "[^".escape(char, "\\^[]")."]", "", "g")) % 2')
|
call add(s:exprs, 'strchars(substitute(substitute(a:info.cur.text, "\\\\.", "", "g"), "[^".escape(char, "\\^[]")."]", "", "g")) % 2')
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ unlet g:delimitMate_nesting_quotes
|
|||||||
iabb def ghi
|
iabb def ghi
|
||||||
call DMTest_quotes('', "idef'", "ghi'", 'a:typed =~ "^idef[''`«|]"')
|
call DMTest_quotes('', "idef'", "ghi'", 'a:typed =~ "^idef[''`«|]"')
|
||||||
iunabb def
|
iunabb def
|
||||||
""call DMTest_quotes('', "'\<CR>\<BS>", "''")
|
""call DMTest_quotes('', "i'\<CR>\<BS>", "''")
|
||||||
|
" Double quote starts a comment in viml
|
||||||
|
set ft=vim
|
||||||
|
call DMTest_single('', 'i"', '"')
|
||||||
|
set ft=
|
||||||
|
|
||||||
call vimtest#Quit()
|
call vimtest#Quit()
|
||||||
|
|||||||
Reference in New Issue
Block a user