1
0
Fork 0
mirror of synced 2024-07-02 13:31:09 -04:00
ultimate-vim/sources_non_forked/vim-ruby/spec/vim/plugin/syntax_test.vim
201341 cc444efe2c Revert "Merge pull request #1 from 201341/swj/dev"
This reverts commit f93aa0fb39, reversing
changes made to e13b2a10a7.
2021-10-27 11:36:39 +08:00

22 lines
521 B
VimL

let s:debug = 0
function! s:CursorHasGroup(group) abort
return synIDattr(synID(line('.'), col('.'), 1), 'name') =~ a:group
endfunction
function! TestSyntax(pattern, group) abort
let pattern = '\C' . a:pattern
call cursor(1, 1)
redraw
let start_match = search(pattern, 'c') && s:CursorHasGroup(a:group)
if s:debug
redraw | sleep 500m
endif
let end_match = search(pattern, 'e') && s:CursorHasGroup(a:group)
if s:debug
redraw | sleep 500m
endif
return start_match && end_match
endfunction