Some checks failed
Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
Detach Plugins / check (GitHub.vim) (push) Has been cancelled
Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
Detach Plugins / check (git.vim) (push) Has been cancelled
Detach Plugins / check (iedit.vim) (push) Has been cancelled
Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
Detach Plugins / check (vim-chat) (push) Has been cancelled
Detach Plugins / check (vim-cheat) (push) Has been cancelled
Detach Plugins / check (vim-todo) (push) Has been cancelled
Detach Plugins / check (xmake.vim) (push) Has been cancelled
test / Linux (nvim, nightly) (push) Has been cancelled
test / Linux (nvim, v0.3.8) (push) Has been cancelled
test / Linux (nvim, v0.4.0) (push) Has been cancelled
test / Linux (nvim, v0.4.2) (push) Has been cancelled
test / Linux (nvim, v0.4.3) (push) Has been cancelled
test / Linux (nvim, v0.4.4) (push) Has been cancelled
test / Linux (nvim, v0.5.0) (push) Has been cancelled
test / Linux (nvim, v0.5.1) (push) Has been cancelled
test / Linux (nvim, v0.6.0) (push) Has been cancelled
test / Linux (nvim, v0.6.1) (push) Has been cancelled
test / Linux (nvim, v0.7.0) (push) Has been cancelled
test / Linux (nvim, v0.7.2) (push) Has been cancelled
test / Linux (nvim, v0.8.0) (push) Has been cancelled
test / Linux (nvim, v0.8.1) (push) Has been cancelled
test / Linux (nvim, v0.8.2) (push) Has been cancelled
test / Linux (nvim, v0.8.3) (push) Has been cancelled
test / Linux (nvim, v0.9.0) (push) Has been cancelled
test / Linux (nvim, v0.9.1) (push) Has been cancelled
test / Linux (true, vim, v7.4.052) (push) Has been cancelled
test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
test / Linux (true, vim, v7.4.629) (push) Has been cancelled
test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
test / Linux (vim, nightly) (push) Has been cancelled
test / Linux (vim, v8.0.0184) (push) Has been cancelled
test / Linux (vim, v8.0.1453) (push) Has been cancelled
test / Linux (vim, v8.1.2269) (push) Has been cancelled
test / Linux (vim, v8.2.2434) (push) Has been cancelled
test / Linux (vim, v8.2.3995) (push) Has been cancelled
test / Windows (nvim, nightly) (push) Has been cancelled
test / Windows (nvim, v0.3.8) (push) Has been cancelled
test / Windows (nvim, v0.4.2) (push) Has been cancelled
test / Windows (nvim, v0.4.3) (push) Has been cancelled
test / Windows (nvim, v0.4.4) (push) Has been cancelled
test / Windows (nvim, v0.5.0) (push) Has been cancelled
test / Windows (nvim, v0.5.1) (push) Has been cancelled
test / Windows (nvim, v0.6.0) (push) Has been cancelled
test / Windows (nvim, v0.6.1) (push) Has been cancelled
test / Windows (nvim, v0.7.0) (push) Has been cancelled
test / Windows (nvim, v0.7.2) (push) Has been cancelled
test / Windows (nvim, v0.8.0) (push) Has been cancelled
test / Windows (nvim, v0.8.1) (push) Has been cancelled
test / Windows (nvim, v0.8.2) (push) Has been cancelled
test / Windows (nvim, v0.8.3) (push) Has been cancelled
test / Windows (nvim, v0.9.0) (push) Has been cancelled
test / Windows (nvim, v0.9.1) (push) Has been cancelled
test / Windows (vim, nightly) (push) Has been cancelled
test / Windows (vim, v7.4.1185) (push) Has been cancelled
test / Windows (vim, v7.4.1689) (push) Has been cancelled
test / Windows (vim, v8.0.0027) (push) Has been cancelled
test / Windows (vim, v8.0.1453) (push) Has been cancelled
test / Windows (vim, v8.1.2269) (push) Has been cancelled
test / Windows (vim, v8.2.2434) (push) Has been cancelled
test / Windows (vim, v8.2.3995) (push) Has been cancelled
docker / docker (push) Has been cancelled
mirror / check (coding) (push) Has been cancelled
mirror / check (gitee) (push) Has been cancelled
mirror / check (gitlab) (push) Has been cancelled
88 lines
2.1 KiB
VimL
88 lines
2.1 KiB
VimL
let s:suite = themis#suite('magic_option')
|
|
let s:assert = themis#helper('assert')
|
|
|
|
" Helper:
|
|
function! s:add_line(str)
|
|
put! =a:str
|
|
endfunction
|
|
function! s:add_lines(lines)
|
|
for line in reverse(a:lines)
|
|
put! =line
|
|
endfor
|
|
endfunction
|
|
function! s:get_pos_char()
|
|
return getline('.')[col('.')-1]
|
|
endfunction
|
|
|
|
|
|
function! s:reset_buffer()
|
|
normal! ggdG
|
|
call s:add_lines(copy(s:line_texts))
|
|
normal! Gddgg0zt
|
|
endfunction
|
|
|
|
function! s:suite.before()
|
|
map / <Plug>(incsearch-forward)
|
|
map ? <Plug>(incsearch-backward)
|
|
map g/ <Plug>(incsearch-stay)
|
|
let s:line_texts = [
|
|
\ 'default cursor pos'
|
|
\ , 'escape only when very magic: ()'
|
|
\ , 'no need to escape when very nomagic: $dummy'
|
|
\ , 'brace and dot matches only when magic: "{{"'
|
|
\ , 'escaped dot and end-of-line matches only when no magic: ZZ'
|
|
\ ]
|
|
call s:reset_buffer()
|
|
endfunction
|
|
|
|
function! s:suite.before_each()
|
|
:1
|
|
endfunction
|
|
|
|
function! s:suite.after()
|
|
call s:reset_buffer()
|
|
let g:incsearch#magic = ''
|
|
endfunction
|
|
|
|
|
|
function! s:suite.can_set_very_magic()
|
|
let g:incsearch#magic = '\v'
|
|
let p = "\\(\\)"
|
|
exec "normal" printf("/%s\<CR>", p)
|
|
call s:assert.equals(getline('.'), s:line_texts[1])
|
|
call s:assert.equals(@/, '\v' . p)
|
|
endfunction
|
|
|
|
function! s:suite.can_set_very_nomagic()
|
|
let g:incsearch#magic = '\V'
|
|
let p = "\\($\\)dummy"
|
|
exec "normal" printf("/%s\<CR>", p)
|
|
call s:assert.equals(getline('.'), s:line_texts[2])
|
|
call s:assert.equals(@/, '\V' . p)
|
|
endfunction
|
|
|
|
function! s:suite.can_set_magic()
|
|
let g:incsearch#magic = '\m'
|
|
let p = "{."
|
|
exec "normal" printf("/%s\<CR>", p)
|
|
call s:assert.equals(getline('.'), s:line_texts[3])
|
|
call s:assert.equals(@/, '\m' . p)
|
|
endfunction
|
|
|
|
function! s:suite.can_set_nomagic()
|
|
let g:incsearch#magic = '\M'
|
|
let p = "Z\\.$"
|
|
exec "normal" printf("/%s\<CR>", p)
|
|
call s:assert.equals(getline('.'), s:line_texts[4])
|
|
call s:assert.equals(@/, '\M' . p)
|
|
endfunction
|
|
|
|
function! s:suite.cannot_set_other_char()
|
|
" considered as '\m'
|
|
let g:incsearch#magic = '\a'
|
|
let p = "{."
|
|
exec "normal" printf("/%s\<CR>", p)
|
|
call s:assert.equals(getline('.'), s:line_texts[3])
|
|
call s:assert.equals(@/, p)
|
|
endfunction
|