mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
Merge 8148c397d573c491d595023adff7886e43201a67 into a494ce1c64a2637719a5c1339abf19ec7c48089c
This commit is contained in:
commit
2851e685e3
15
runtime/autoload/dist/vimindent.vim
vendored
15
runtime/autoload/dist/vimindent.vim
vendored
@ -1057,19 +1057,16 @@ enddef
|
|||||||
|
|
||||||
def IsInside(lnum: number, syntax: string): bool # {{{3
|
def IsInside(lnum: number, syntax: string): bool # {{{3
|
||||||
if syntax == 'EnumBlock'
|
if syntax == 'EnumBlock'
|
||||||
var cur_pos = getpos('.')
|
defer setpos('.', getcurpos())
|
||||||
cursor(lnum, 1)
|
cursor(lnum, 1)
|
||||||
var enum_pos = search('^\C\s*\%(export\s\)\=\s*enum\s\+\S\+', 'bnW')
|
|
||||||
var endenum_pos = search('^\C\s*endenum\>', 'bnW')
|
|
||||||
setpos('.', cur_pos)
|
|
||||||
|
|
||||||
if enum_pos == 0 && endenum_pos == 0
|
const enum_pos: number = search('^\C\s*\%(export\s\+\)\=enum\s\+\S\+', 'bcnW')
|
||||||
|
if enum_pos == 0 || enum_pos == lnum
|
||||||
return false
|
return false
|
||||||
endif
|
endif
|
||||||
if (enum_pos > 0 && (endenum_pos == 0 || enum_pos > endenum_pos))
|
|
||||||
return true
|
const endenum_pos: number = search('^\C\s*endenum\>', 'bcnW')
|
||||||
endif
|
return endenum_pos == 0 || (endenum_pos != lnum && enum_pos > endenum_pos)
|
||||||
return false
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists('b:vimindent')
|
if !exists('b:vimindent')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user