From 164ca5f33ffc01de9ff531e5655aedcb152d4e45 Mon Sep 17 00:00:00 2001 From: machakann Date: Sun, 19 Jul 2015 13:25:51 +0800 Subject: [PATCH] Define a new behavior of 'skip_space' option when it is 2. --- autoload/operator/sandwich.vim | 6 +- doc/operator-sandwich.jax | 9 +- doc/operator-sandwich.txt | 16 +- test/operator-delete.vim | 3835 +++++++------- test/operator-replace.vim | 9120 ++++++++++++++++---------------- 5 files changed, 6661 insertions(+), 6325 deletions(-) diff --git a/autoload/operator/sandwich.vim b/autoload/operator/sandwich.vim index 763c73d..60a66b1 100644 --- a/autoload/operator/sandwich.vim +++ b/autoload/operator/sandwich.vim @@ -737,7 +737,7 @@ function! s:search(recipes) dict abort "{{{ if i == 1 || opt.integrated.skip_space let head_c = s:get_cursorchar(head) let tail_c = s:get_cursorchar(tail) - if head_c ==# tail_c + if head_c ==# tail_c && !(opt.integrated.skip_space == 2 && head_c =~# '\s') let target = { \ 'head1': head, 'tail1': head, \ 'head2': tail, 'tail2': tail, @@ -2305,7 +2305,7 @@ let s:default_opt.delete.line = { \ 'cursor' : 'inner_head', \ 'noremap' : 1, \ 'regex' : 0, - \ 'skip_space': 1, + \ 'skip_space': 2, \ 'skip_char' : 0, \ 'highlight' : 1, \ 'command' : [], @@ -2344,7 +2344,7 @@ let s:default_opt.replace.line = { \ 'regex' : 0, \ 'expr' : 0, \ 'noremap' : 1, - \ 'skip_space': 1, + \ 'skip_space': 2, \ 'skip_char' : 0, \ 'highlight' : 1, \ 'command' : [], diff --git a/doc/operator-sandwich.jax b/doc/operator-sandwich.jax index 66c606f..352cf98 100644 --- a/doc/operator-sandwich.jax +++ b/doc/operator-sandwich.jax @@ -862,8 +862,8 @@ highlight skip_space - 値が真なら、指定された文字列の両端がスペースであった場合にこれらをスキ - ップします。 + 値が 1 なら、指定された文字列の両端がスペースであった場合にこれらをス + キップします。 > let g:sandwich#recipes += [ \ {'buns': ['(', ')'], 'skip_space': 0} @@ -887,6 +887,7 @@ skip_space " Press sda" " ?"foo" ---> ?foo : ? is space < + 両端が空白の場合にもこれをスキップするためには値を 2 にします。 デフォルト値 * add @@ -895,11 +896,11 @@ skip_space - block: 1 * delete - char : 1 - - line : 1 + - line : 2 - block: 1 * replace - char : 1 - - line : 1 + - line : 2 - block: 1 diff --git a/doc/operator-sandwich.txt b/doc/operator-sandwich.txt index 1a07ebf..13e79ff 100644 --- a/doc/operator-sandwich.txt +++ b/doc/operator-sandwich.txt @@ -870,7 +870,7 @@ highlight skip_space This option enables to skip spaces at both ends of a assigned region. - If the value is true, adjust the both ends to skip white spaces. + If the value is 1, adjust the both ends to skip white spaces. > let g:sandwich#recipes += [ \ {'buns': ['(', ')'], 'skip_space': 0} @@ -895,6 +895,8 @@ skip_space " Press sda" " ?"foo" ---> ?foo : ? is space < + If the value is 2, adjust the both ends to skip white spaces even + though the both ends are white spaces. Default values * add @@ -902,13 +904,13 @@ skip_space - line : 1 - block: 1 * delete - - char : 1 - - line : 1 - - block: 1 + - char : 2 + - line : 2 + - block: 2 * replace - - char : 1 - - line : 1 - - block: 1 + - char : 2 + - line : 2 + - block: 2 diff --git a/test/operator-delete.vim b/test/operator-delete.vim index 0c1994a..1606193 100644 --- a/test/operator-delete.vim +++ b/test/operator-delete.vim @@ -989,7 +989,7 @@ function! s:suite.charwise_n_option_regex() abort "{{{ endfunction "}}} function! s:suite.charwise_n_option_skip_space() abort "{{{ - """ on + """ 1 " #111 call setline('.', '"foo"') normal 0sd$ @@ -1011,8 +1011,8 @@ function! s:suite.charwise_n_option_skip_space() abort "{{{ normal 0sd$ call g:assert.equals(getline('.'), '"foo"', 'failed at #114') - """ off - call operator#sandwich#set('delete', 'char', 'skip_space', 0) + """ 2 + call operator#sandwich#set('delete', 'char', 'skip_space', 2) " #115 call setline('.', '"foo"') normal 0sd$ @@ -1021,35 +1021,57 @@ function! s:suite.charwise_n_option_skip_space() abort "{{{ " #116 call setline('.', ' "foo"') normal 0sd$ - call g:assert.equals(getline('.'), ' "foo"', 'failed at #116') + call g:assert.equals(getline('.'), ' foo', 'failed at #116') " #117 call setline('.', '"foo" ') normal 0sd$ - call g:assert.equals(getline('.'), '"foo" ', 'failed at #117') + call g:assert.equals(getline('.'), 'foo ', 'failed at #117') " #118 + call setline('.', ' "foo" ') + normal 0sd$ + call g:assert.equals(getline('.'), ' foo ', 'failed at #118') + + """ 0 + call operator#sandwich#set('delete', 'char', 'skip_space', 0) + " #119 + call setline('.', '"foo"') + normal 0sd$ + call g:assert.equals(getline('.'), 'foo', 'failed at #119') + + " #120 + call setline('.', ' "foo"') + normal 0sd$ + call g:assert.equals(getline('.'), ' "foo"', 'failed at #120') + + " #121 + call setline('.', '"foo" ') + normal 0sd$ + call g:assert.equals(getline('.'), '"foo" ', 'failed at #121') + + " #122 " do not skip! call setline('.', ' "foo" ') normal 0sd$ - call g:assert.equals(getline('.'), '"foo"', 'failed at #118') + call g:assert.equals(getline('.'), '"foo"', 'failed at #122') call operator#sandwich#set('delete', 'char', 'skip_space', 1) endfunction "}}} function! s:suite.charwise_n_option_skip_char() abort "{{{ """ off - " #119 + " #123 call setline('.', 'aa(foo)bb') normal 0sd$ - call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #119') + call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #123') """ on call operator#sandwich#set('delete', 'char', 'skip_char', 1) - " #120 + " #124 call setline('.', 'aa(foo)bb') normal 0sd$ - call g:assert.equals(getline('.'), 'aafoobb', 'failed at #120') + call g:assert.equals(getline('.'), 'aafoobb', 'failed at #124') call operator#sandwich#set('delete', 'char', 'skip_char', 0) endfunction @@ -1057,10 +1079,10 @@ endfunction function! s:suite.charwise_n_option_command() abort "{{{ call operator#sandwich#set('delete', 'char', 'command', ['normal! `[dv`]']) - " #121 + " #125 call setline('.', '(foo)') normal 0sda( - call g:assert.equals(getline('.'), '', 'failed at #121') + call g:assert.equals(getline('.'), '', 'failed at #125') call operator#sandwich#set('delete', 'char', 'command', []) endfunction @@ -1070,67 +1092,19 @@ function! s:suite.charwise_n_option_linewise() abort "{{{ call operator#sandwich#set('delete', 'char', 'linewise', 1) """ 1 - " #122 + " #126 call append(0, ['(', 'foo', ')']) normal ggsd7l - call g:assert.equals(getline(1), 'foo', 'failed at #122') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #122') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #122') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #122') - - %delete - - " #123 - call append(0, ['( ', 'foo', ' )']) - normal ggsd11l - call g:assert.equals(getline(1), 'foo', 'failed at #123') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #123') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #123') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #123') - - %delete - - " #124 - call append(0, ['(aa', 'foo', 'aa)']) - normal ggsd11l - call g:assert.equals(getline(1), 'aa', 'failed at #124') - call g:assert.equals(getline(2), 'foo', 'failed at #124') - call g:assert.equals(getline(3), 'aa', 'failed at #124') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #124') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #124') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #124') - - %delete - - " #125 - call append(0, ['(aa', 'foo', ')']) - normal ggsd9l - call g:assert.equals(getline(1), 'aa', 'failed at #125') - call g:assert.equals(getline(2), 'foo', 'failed at #125') - call g:assert.equals(getline(3), '', 'failed at #125') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #125') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #125') - call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #125') - - %delete - - " #126 - call append(0, ['(', 'foo', 'aa)']) - normal ggsd9l call g:assert.equals(getline(1), 'foo', 'failed at #126') - call g:assert.equals(getline(2), 'aa', 'failed at #126') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #126') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #126') - call g:assert.equals(getpos("']"), [0, 2, 3, 0], 'failed at #126') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #126') %delete - call operator#sandwich#set('delete', 'char', 'linewise', 2) - - """ 2 " #127 - call append(0, ['(', 'foo', ')']) - normal ggsd7l + call append(0, ['( ', 'foo', ' )']) + normal ggsd11l call g:assert.equals(getline(1), 'foo', 'failed at #127') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #127') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #127') @@ -1139,76 +1113,90 @@ function! s:suite.charwise_n_option_linewise() abort "{{{ %delete " #128 - call append(0, ['( ', 'foo', ' )']) + call append(0, ['(aa', 'foo', 'aa)']) normal ggsd11l - call g:assert.equals(getline(1), 'foo', 'failed at #128') + call g:assert.equals(getline(1), 'aa', 'failed at #128') + call g:assert.equals(getline(2), 'foo', 'failed at #128') + call g:assert.equals(getline(3), 'aa', 'failed at #128') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #128') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #128') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #128') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #128') %delete " #129 - call append(0, ['(aa', 'foo', 'aa)']) - normal ggsd11l - call g:assert.equals(getline(1), 'foo', 'failed at #129') + call append(0, ['(aa', 'foo', ')']) + normal ggsd9l + call g:assert.equals(getline(1), 'aa', 'failed at #129') + call g:assert.equals(getline(2), 'foo', 'failed at #129') + call g:assert.equals(getline(3), '', 'failed at #129') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #129') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #129') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #129') + call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #129') %delete " #130 + call append(0, ['(', 'foo', 'aa)']) + normal ggsd9l + call g:assert.equals(getline(1), 'foo', 'failed at #130') + call g:assert.equals(getline(2), 'aa', 'failed at #130') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #130') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #130') + call g:assert.equals(getpos("']"), [0, 2, 3, 0], 'failed at #130') + + %delete + + call operator#sandwich#set('delete', 'char', 'linewise', 2) + + """ 2 + " #131 + call append(0, ['(', 'foo', ')']) + normal ggsd7l + call g:assert.equals(getline(1), 'foo', 'failed at #131') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #131') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #131') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #131') + + %delete + + " #132 + call append(0, ['( ', 'foo', ' )']) + normal ggsd11l + call g:assert.equals(getline(1), 'foo', 'failed at #132') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #132') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #132') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #132') + + %delete + + " #133 + call append(0, ['(aa', 'foo', 'aa)']) + normal ggsd11l + call g:assert.equals(getline(1), 'foo', 'failed at #133') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #133') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #133') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #133') + + %delete + + " #134 call append(0, ['aa', '(foo)', 'bb']) normal ggjsd5l - call g:assert.equals(getline(1), 'aa', 'failed at #130') - call g:assert.equals(getline(2), 'bb', 'failed at #130') - call g:assert.equals(getline(3), '', 'failed at #130') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #130') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #130') - call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #130') + call g:assert.equals(getline(1), 'aa', 'failed at #134') + call g:assert.equals(getline(2), 'bb', 'failed at #134') + call g:assert.equals(getline(3), '', 'failed at #134') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #134') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #134') + call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #134') set whichwrap& endfunction "}}} function! s:suite.charwise_x_default_recipes() abort "{{{ - " #131 - call setline('.', '(foo)') - normal 0v4lsd - call g:assert.equals(getline('.'), 'foo', 'failed at #131') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #131') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #131') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #131') - - " #132 - call setline('.', '[foo]') - normal 0v4lsd - call g:assert.equals(getline('.'), 'foo', 'failed at #132') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #132') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #132') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #132') - - " #133 - call setline('.', '{foo}') - normal 0v4lsd - call g:assert.equals(getline('.'), 'foo', 'failed at #133') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #133') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #133') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #133') - - " #134 - call setline('.', '') - normal 0v4lsd - call g:assert.equals(getline('.'), 'foo', 'failed at #134') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #134') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #134') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #134') -endfunction -"}}} -function! s:suite.charwise_x_not_registered() abort "{{{ " #135 - call setline('.', 'afooa') + call setline('.', '(foo)') normal 0v4lsd call g:assert.equals(getline('.'), 'foo', 'failed at #135') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #135') @@ -1216,91 +1204,125 @@ function! s:suite.charwise_x_not_registered() abort "{{{ call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #135') " #136 - call setline('.', '*foo*') - normal 0v$sd + call setline('.', '[foo]') + normal 0v4lsd call g:assert.equals(getline('.'), 'foo', 'failed at #136') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #136') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #136') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #136') -endfunction -"}}} -function! s:suite.charwise_x_positioning() abort "{{{ + " #137 - call setline('.', '(foo)bar') + call setline('.', '{foo}') normal 0v4lsd - call g:assert.equals(getline('.'), 'foobar', 'failed at #137') + call g:assert.equals(getline('.'), 'foo', 'failed at #137') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #137') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #137') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #137') " #138 - call setline('.', 'foo(bar)') - normal 03lv4lsd - call g:assert.equals(getline('.'), 'foobar', 'failed at #138') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #138') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #138') - call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #138') - + call setline('.', '') + normal 0v4lsd + call g:assert.equals(getline('.'), 'foo', 'failed at #138') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #138') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #138') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #138') +endfunction +"}}} +function! s:suite.charwise_x_not_registered() abort "{{{ " #139 - call setline('.', 'foo(bar)baz') - normal 03lv4lsd - call g:assert.equals(getline('.'), 'foobarbaz', 'failed at #139') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #139') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #139') - call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #139') - - %delete + call setline('.', 'afooa') + normal 0v4lsd + call g:assert.equals(getline('.'), 'foo', 'failed at #139') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #139') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #139') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #139') " #140 - call append(0, ['(foo', 'bar', 'baz)']) - normal ggv2j3lsd - call g:assert.equals(getline(1), 'foo', 'failed at #140') - call g:assert.equals(getline(2), 'bar', 'failed at #140') - call g:assert.equals(getline(3), 'baz', 'failed at #140') + call setline('.', '*foo*') + normal 0v$sd + call g:assert.equals(getline('.'), 'foo', 'failed at #140') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #140') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #140') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #140') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #140') endfunction "}}} -function! s:suite.charwise_x_a_character() abort "{{{ +function! s:suite.charwise_x_positioning() abort "{{{ " #141 - call setline('.', '(a)') - normal 0v2lsd - call g:assert.equals(getline('.'), 'a', 'failed at #141') + call setline('.', '(foo)bar') + normal 0v4lsd + call g:assert.equals(getline('.'), 'foobar', 'failed at #141') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #141') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #141') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #141') -endfunction -"}}} -function! s:suite.charwise_x_nothing_inside() abort "{{{ - " #142 - call setline('.', '()') - normal 0vlsd - call g:assert.equals(getline('.'), '', 'failed at #142') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #142') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #142') - call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #142') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #141') - %delete + " #142 + call setline('.', 'foo(bar)') + normal 03lv4lsd + call g:assert.equals(getline('.'), 'foobar', 'failed at #142') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #142') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #142') + call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #142') " #143 - call setline('.', 'foo()bar') - normal 03lvlsd - call g:assert.equals(getline('.'), 'foobar', 'failed at #143') + call setline('.', 'foo(bar)baz') + normal 03lv4lsd + call g:assert.equals(getline('.'), 'foobarbaz', 'failed at #143') call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #143') call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #143') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #143') + call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #143') %delete " #144 - call append(0, ['(', ')']) - normal ggvjsd - call g:assert.equals(getline(1), '', 'failed at #144') - call g:assert.equals(getline(2), '', 'failed at #144') + call append(0, ['(foo', 'bar', 'baz)']) + normal ggv2j3lsd + call g:assert.equals(getline(1), 'foo', 'failed at #144') + call g:assert.equals(getline(2), 'bar', 'failed at #144') + call g:assert.equals(getline(3), 'baz', 'failed at #144') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #144') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #144') - call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #144') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #144') +endfunction +"}}} +function! s:suite.charwise_x_a_character() abort "{{{ + " #145 + call setline('.', '(a)') + normal 0v2lsd + call g:assert.equals(getline('.'), 'a', 'failed at #145') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #145') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #145') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #145') +endfunction +"}}} +function! s:suite.charwise_x_nothing_inside() abort "{{{ + " #146 + call setline('.', '()') + normal 0vlsd + call g:assert.equals(getline('.'), '', 'failed at #146') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #146') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #146') + call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #146') + + %delete + + " #147 + call setline('.', 'foo()bar') + normal 03lvlsd + call g:assert.equals(getline('.'), 'foobar', 'failed at #147') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #147') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #147') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #147') + + %delete + + " #148 + call append(0, ['(', ')']) + normal ggvjsd + call g:assert.equals(getline(1), '', 'failed at #148') + call g:assert.equals(getline(2), '', 'failed at #148') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #148') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #148') + call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #148') endfunction "}}} function! s:suite.charwise_x_breaking() abort "{{{ @@ -1309,49 +1331,49 @@ function! s:suite.charwise_x_breaking() abort "{{{ \ {'buns': ["bb\nbbb\nbb", "bb\nbbb\nbb"], 'input':['b']}, \ ] - " #145 + " #149 call append(0, ['aa', 'aaafooaaa', 'aa']) normal ggv2jlsd - call g:assert.equals(getline(1), 'foo', 'failed at #145') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #145') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #145') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #145') + call g:assert.equals(getline(1), 'foo', 'failed at #149') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #149') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #149') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #149') %delete - " #146 + " #150 call append(0, ['bb', 'bbb', 'bbfoobb', 'bbb', 'bb']) normal ggv4jlsd - call g:assert.equals(getline(1), 'foo', 'failed at #146') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #146') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #146') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #146') + call g:assert.equals(getline(1), 'foo', 'failed at #150') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #150') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #150') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #150') endfunction "}}} function! s:suite.charwise_x_count() abort "{{{ - " #147 + " #151 call setline('.', '((foo))') normal 0v$2sd - call g:assert.equals(getline('.'), 'foo', 'failed at #147') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #147') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #147') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #147') + call g:assert.equals(getline('.'), 'foo', 'failed at #151') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #151') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #151') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #151') - " #148 + " #152 call setline('.', '{[(foo)]}') normal 0v$3sd - call g:assert.equals(getline('.'), 'foo', 'failed at #148') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #148') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #148') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #148') + call g:assert.equals(getline('.'), 'foo', 'failed at #152') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #152') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #152') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #152') - " #149 + " #153 call setline('.', 'foo{[(bar)]}baz') normal 03lv8l3sd - call g:assert.equals(getline('.'), 'foobarbaz', 'failed at #149') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #149') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #149') - call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #149') + call g:assert.equals(getline('.'), 'foobarbaz', 'failed at #153') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #153') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #153') + call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #153') endfunction "}}} function! s:suite.charwise_x_external_textobj() abort"{{{ @@ -1363,25 +1385,25 @@ function! s:suite.charwise_x_external_textobj() abort"{{{ \ {'external': ['it', 'at']}, \ ] - " #150 + " #154 call setline('.', '{[(foo)]}') normal 02lv4lsd - call g:assert.equals(getline('.'), '{[foo]}', 'failed at #150') + call g:assert.equals(getline('.'), '{[foo]}', 'failed at #154') - " #151 + " #155 call setline('.', '{[(foo)]}') normal 0lv6lsd - call g:assert.equals(getline('.'), '{(foo)}', 'failed at #151') + call g:assert.equals(getline('.'), '{(foo)}', 'failed at #155') - " #152 + " #156 call setline('.', '{[(foo)]}') normal 0v8lsd - call g:assert.equals(getline('.'), '[(foo)]', 'failed at #152') + call g:assert.equals(getline('.'), '[(foo)]', 'failed at #156') - " #153 + " #157 call setline('.', 'foo') normal 0v$sd - call g:assert.equals(getline('.'), 'foo', 'failed at #153') + call g:assert.equals(getline('.'), 'foo', 'failed at #157') unlet g:sandwich#recipes unlet g:operator#sandwich#recipes @@ -1390,59 +1412,33 @@ endfunction function! s:suite.charwise_x_option_cursor() abort "{{{ """"" cursor """ inner_head - " #96 + " #100 call setline('.', '(((foo)))') normal 0lv%2sd - call g:assert.equals(getline('.'), '(foo)', 'failed at #96') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #96') + call g:assert.equals(getline('.'), '(foo)', 'failed at #100') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #100') - " #97 + " #101 normal 0va(sd - call g:assert.equals(getline('.'), 'foo', 'failed at #97') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #97') + call g:assert.equals(getline('.'), 'foo', 'failed at #101') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #101') """ keep - " #98 + " #102 call operator#sandwich#set('delete', 'char', 'cursor', 'keep') call setline('.', '(((foo)))') normal 0lv%2sd - call g:assert.equals(getline('.'), '(foo)', 'failed at #98') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #98') - - " #99 - normal va(osd - call g:assert.equals(getline('.'), 'foo', 'failed at #99') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #99') - - """ inner_tail - " #100 - call operator#sandwich#set('delete', 'char', 'cursor', 'inner_tail') - call setline('.', '(((foo)))') - normal 0lv%o2sd - call g:assert.equals(getline('.'), '(foo)', 'failed at #100') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #100') - - " #101 - normal va(osd - call g:assert.equals(getline('.'), 'foo', 'failed at #101') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #101') - - """ head - " #102 - call operator#sandwich#set('delete', 'char', 'cursor', 'head') - call setline('.', '(((foo)))') - normal 0lv%2sd call g:assert.equals(getline('.'), '(foo)', 'failed at #102') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #102') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #102') " #103 - normal va(sd + normal va(osd call g:assert.equals(getline('.'), 'foo', 'failed at #103') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #103') - """ tail + """ inner_tail " #104 - call operator#sandwich#set('delete', 'char', 'cursor', 'tail') + call operator#sandwich#set('delete', 'char', 'cursor', 'inner_tail') call setline('.', '(((foo)))') normal 0lv%o2sd call g:assert.equals(getline('.'), '(foo)', 'failed at #104') @@ -1453,6 +1449,32 @@ function! s:suite.charwise_x_option_cursor() abort "{{{ call g:assert.equals(getline('.'), 'foo', 'failed at #105') call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #105') + """ head + " #106 + call operator#sandwich#set('delete', 'char', 'cursor', 'head') + call setline('.', '(((foo)))') + normal 0lv%2sd + call g:assert.equals(getline('.'), '(foo)', 'failed at #106') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #106') + + " #107 + normal va(sd + call g:assert.equals(getline('.'), 'foo', 'failed at #107') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #107') + + """ tail + " #108 + call operator#sandwich#set('delete', 'char', 'cursor', 'tail') + call setline('.', '(((foo)))') + normal 0lv%o2sd + call g:assert.equals(getline('.'), '(foo)', 'failed at #108') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #108') + + " #109 + normal va(osd + call g:assert.equals(getline('.'), 'foo', 'failed at #109') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #109') + call operator#sandwich#set('delete', 'char', 'cursor', 'inner_head') endfunction "}}} @@ -1464,27 +1486,27 @@ function! s:suite.charwise_x_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #106 + " #110 call setline('.', '{(foo)}') normal 0v6lsd - call g:assert.equals(getline('.'), '(foo)', 'failed at #106') + call g:assert.equals(getline('.'), '(foo)', 'failed at #110') - " #107 + " #111 call setline('.', '{(foo)}') normal 0lv4lsd - call g:assert.equals(getline('.'), '{(foo)}', 'failed at #107') + call g:assert.equals(getline('.'), '{(foo)}', 'failed at #111') """ off - " #108 + " #112 call operator#sandwich#set('delete', 'char', 'noremap', 0) call setline('.', '{(foo)}') normal 0v6lsd - call g:assert.equals(getline('.'), '{(foo)}', 'failed at #108') + call g:assert.equals(getline('.'), '{(foo)}', 'failed at #112') - " #109 + " #113 call setline('.', '{(foo)}') normal 0lv4lsd - call g:assert.equals(getline('.'), '{foo}', 'failed at #109') + call g:assert.equals(getline('.'), '{foo}', 'failed at #113') unlet! g:sandwich#recipes unlet! g:operator#sandwich#recipes @@ -1498,27 +1520,27 @@ function! s:suite.charwise_x_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #110 + " #114 call setline('.', '\d\+foo\d\+') normal 0v$sd - call g:assert.equals(getline('.'), 'foo', 'failed at #110') + call g:assert.equals(getline('.'), 'foo', 'failed at #114') - " #111 + " #115 call setline('.', '888foo888') normal 0v$sd - call g:assert.equals(getline('.'), '88foo88', 'failed at #111') + call g:assert.equals(getline('.'), '88foo88', 'failed at #115') """ on call operator#sandwich#set('delete', 'char', 'regex', 1) - " #112 + " #116 call setline('.', '\d\+foo\d\+') normal 0v$sd - call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #112') + call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #116') - " #113 + " #117 call setline('.', '888foo888') normal 0v$sd - call g:assert.equals(getline('.'), 'foo', 'failed at #113') + call g:assert.equals(getline('.'), 'foo', 'failed at #117') call operator#sandwich#set('delete', 'char', 'regex', 0) unlet! g:sandwich#recipes @@ -1526,30 +1548,7 @@ function! s:suite.charwise_x_option_regex() abort "{{{ endfunction "}}} function! s:suite.charwise_x_option_skip_space() abort "{{{ - """ on - " #114 - call setline('.', '"foo"') - normal 0v$sd - call g:assert.equals(getline('.'), 'foo', 'failed at #114') - - " #115 - call setline('.', ' "foo"') - normal 0v$sd - call g:assert.equals(getline('.'), ' foo', 'failed at #115') - - " #116 - call setline('.', '"foo" ') - normal 0v$sd - call g:assert.equals(getline('.'), 'foo ', 'failed at #116') - - " #117 - " do not skip! - call setline('.', ' "foo" ') - normal 0v$sd - call g:assert.equals(getline('.'), '"foo"', 'failed at #117') - - """ off - call operator#sandwich#set('delete', 'char', 'skip_space', 0) + """ 1 " #118 call setline('.', '"foo"') normal 0v$sd @@ -1558,12 +1557,12 @@ function! s:suite.charwise_x_option_skip_space() abort "{{{ " #119 call setline('.', ' "foo"') normal 0v$sd - call g:assert.equals(getline('.'), ' "foo"', 'failed at #119') + call g:assert.equals(getline('.'), ' foo', 'failed at #119') " #120 call setline('.', '"foo" ') normal 0v$sd - call g:assert.equals(getline('.'), '"foo" ', 'failed at #120') + call g:assert.equals(getline('.'), 'foo ', 'failed at #120') " #121 " do not skip! @@ -1571,22 +1570,67 @@ function! s:suite.charwise_x_option_skip_space() abort "{{{ normal 0v$sd call g:assert.equals(getline('.'), '"foo"', 'failed at #121') + """ 2 + call operator#sandwich#set('delete', 'char', 'skip_space', 2) + " #122 + call setline('.', '"foo"') + normal 0v$sd + call g:assert.equals(getline('.'), 'foo', 'failed at #122') + + " #123 + call setline('.', ' "foo"') + normal 0v$sd + call g:assert.equals(getline('.'), ' foo', 'failed at #123') + + " #124 + call setline('.', '"foo" ') + normal 0v$sd + call g:assert.equals(getline('.'), 'foo ', 'failed at #124') + + " #125 + call setline('.', ' "foo" ') + normal 0v$sd + call g:assert.equals(getline('.'), ' foo ', 'failed at #125') + + """ 0 + call operator#sandwich#set('delete', 'char', 'skip_space', 0) + " #126 + call setline('.', '"foo"') + normal 0v$sd + call g:assert.equals(getline('.'), 'foo', 'failed at #126') + + " #127 + call setline('.', ' "foo"') + normal 0v$sd + call g:assert.equals(getline('.'), ' "foo"', 'failed at #127') + + " #128 + call setline('.', '"foo" ') + normal 0v$sd + call g:assert.equals(getline('.'), '"foo" ', 'failed at #128') + + " #129 + " do not skip! + call setline('.', ' "foo" ') + normal 0v$sd + call g:assert.equals(getline('.'), '"foo"', 'failed at #129') + call operator#sandwich#set('delete', 'char', 'skip_space', 1) endfunction "}}} function! s:suite.charwise_x_option_skip_char() abort "{{{ """ off - " #122 + " #130 call setline('.', 'aa(foo)bb') normal 0v$sd - call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #122') + call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #130') """ on call operator#sandwich#set('delete', 'char', 'skip_char', 1) - " #123 + " #131 call setline('.', 'aa(foo)bb') normal 0v$sd - call g:assert.equals(getline('.'), 'aafoobb', 'failed at #123') + call g:assert.equals(getline('.'), 'aafoobb', 'failed at #131') call operator#sandwich#set('delete', 'char', 'skip_char', 0) endfunction @@ -1594,10 +1638,10 @@ endfunction function! s:suite.charwise_x_option_command() abort "{{{ call operator#sandwich#set('delete', 'char', 'command', ['normal! `[dv`]']) - " #124 + " #132 call setline('.', '(foo)') normal 0va(sd - call g:assert.equals(getline('.'), '', 'failed at #124') + call g:assert.equals(getline('.'), '', 'failed at #132') call operator#sandwich#set('delete', 'char', 'command', []) endfunction @@ -1607,148 +1651,68 @@ function! s:suite.charwise_x_option_linewise() abort "{{{ call operator#sandwich#set('delete', 'char', 'linewise', 1) """ 1 - " #125 + " #133 call append(0, ['(', 'foo', ')']) normal ggv2jsd - call g:assert.equals(getline(1), 'foo', 'failed at #125') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #125') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #125') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #125') + call g:assert.equals(getline(1), 'foo', 'failed at #133') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #133') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #133') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #133') %delete - " #126 + " #134 call append(0, ['( ', 'foo', ' )']) normal ggv2j2lsd - call g:assert.equals(getline(1), 'foo', 'failed at #126') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #126') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #126') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #126') + call g:assert.equals(getline(1), 'foo', 'failed at #134') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #134') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #134') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #134') %delete - " #127 + " #135 call append(0, ['(aa', 'foo', 'aa)']) normal ggv2j2lsd - call g:assert.equals(getline(1), 'aa', 'failed at #127') - call g:assert.equals(getline(2), 'foo', 'failed at #127') - call g:assert.equals(getline(3), 'aa', 'failed at #127') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #127') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #127') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #127') + call g:assert.equals(getline(1), 'aa', 'failed at #135') + call g:assert.equals(getline(2), 'foo', 'failed at #135') + call g:assert.equals(getline(3), 'aa', 'failed at #135') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #135') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #135') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #135') %delete - " #128 + " #136 call append(0, ['(aa', 'foo', ')']) normal ggv2jsd - call g:assert.equals(getline(1), 'aa', 'failed at #128') - call g:assert.equals(getline(2), 'foo', 'failed at #128') - call g:assert.equals(getline(3), '', 'failed at #128') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #128') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #128') - call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #128') + call g:assert.equals(getline(1), 'aa', 'failed at #136') + call g:assert.equals(getline(2), 'foo', 'failed at #136') + call g:assert.equals(getline(3), '', 'failed at #136') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #136') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #136') + call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #136') %delete - " #129 + " #137 call append(0, ['(', 'foo', 'aa)']) normal ggv2j2lsd - call g:assert.equals(getline(1), 'foo', 'failed at #129') - call g:assert.equals(getline(2), 'aa', 'failed at #129') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #129') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #129') - call g:assert.equals(getpos("']"), [0, 2, 3, 0], 'failed at #129') + call g:assert.equals(getline(1), 'foo', 'failed at #137') + call g:assert.equals(getline(2), 'aa', 'failed at #137') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #137') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #137') + call g:assert.equals(getpos("']"), [0, 2, 3, 0], 'failed at #137') %delete call operator#sandwich#set('delete', 'char', 'linewise', 2) """ 2 - " #130 - call append(0, ['(', 'foo', ')']) - normal ggv2jsd - call g:assert.equals(getline(1), 'foo', 'failed at #130') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #130') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #130') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #130') - - %delete - - " #131 - call append(0, ['( ', 'foo', ' )']) - normal ggv2j2lsd - call g:assert.equals(getline(1), 'foo', 'failed at #131') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #131') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #131') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #131') - - %delete - - " #132 - call append(0, ['(aa', 'foo', 'aa)']) - normal ggv2j2lsd - call g:assert.equals(getline(1), 'foo', 'failed at #132') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #132') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #132') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #132') - - %delete - - " #133 - call append(0, ['aa', '(foo)', 'bb']) - normal ggjv4lsd - call g:assert.equals(getline(1), 'aa', 'failed at #133') - call g:assert.equals(getline(2), 'bb', 'failed at #133') - call g:assert.equals(getline(3), '', 'failed at #133') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #133') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #133') - call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #133') - - set whichwrap& -endfunction -"}}} - -" line-wise -function! s:suite.linewise_n_default_recipes() abort "{{{ - " #134 - call setline('.', '(foo)') - normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #134') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #134') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #134') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #134') - - " #135 - call setline('.', '[foo]') - normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #135') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #135') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #135') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #135') - - " #136 - call setline('.', '{foo}') - normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #136') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #136') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #136') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #136') - - " #137 - call setline('.', '') - normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #137') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #137') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #137') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #137') - - %delete - " #138 call append(0, ['(', 'foo', ')']) - normal ggsdVa( - call g:assert.equals(getline('.'), 'foo', 'failed at #138') + normal ggv2jsd + call g:assert.equals(getline(1), 'foo', 'failed at #138') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #138') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #138') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #138') @@ -1756,9 +1720,9 @@ function! s:suite.linewise_n_default_recipes() abort "{{{ %delete " #139 - call append(0, ['[', 'foo', ']']) - normal ggsdVa[ - call g:assert.equals(getline('.'), 'foo', 'failed at #139') + call append(0, ['( ', 'foo', ' )']) + normal ggv2j2lsd + call g:assert.equals(getline(1), 'foo', 'failed at #139') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #139') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #139') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #139') @@ -1766,9 +1730,9 @@ function! s:suite.linewise_n_default_recipes() abort "{{{ %delete " #140 - call append(0, ['{', 'foo', '}']) - normal ggsdVa{ - call g:assert.equals(getline('.'), 'foo', 'failed at #140') + call append(0, ['(aa', 'foo', 'aa)']) + normal ggv2j2lsd + call g:assert.equals(getline(1), 'foo', 'failed at #140') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #140') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #140') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #140') @@ -1776,17 +1740,23 @@ function! s:suite.linewise_n_default_recipes() abort "{{{ %delete " #141 - call append(0, ['<', 'foo', '>']) - normal ggsdVa< - call g:assert.equals(getline('.'), 'foo', 'failed at #141') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #141') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #141') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #141') + call append(0, ['aa', '(foo)', 'bb']) + normal ggjv4lsd + call g:assert.equals(getline(1), 'aa', 'failed at #141') + call g:assert.equals(getline(2), 'bb', 'failed at #141') + call g:assert.equals(getline(3), '', 'failed at #141') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #141') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #141') + call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #141') + + set whichwrap& endfunction "}}} -function! s:suite.linewise_n_not_registered() abort "{{{ + +" line-wise +function! s:suite.linewise_n_default_recipes() abort "{{{ " #142 - call setline('.', 'afooa') + call setline('.', '(foo)') normal 0sdVl call g:assert.equals(getline('.'), 'foo', 'failed at #142') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #142') @@ -1794,130 +1764,204 @@ function! s:suite.linewise_n_not_registered() abort "{{{ call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #142') " #143 - call setline('.', '*foo*') + call setline('.', '[foo]') normal 0sdVl call g:assert.equals(getline('.'), 'foo', 'failed at #143') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #143') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #143') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #143') - %delete - " #144 - call append(0, ['a', 'foo', 'a']) - normal ggsd2j + call setline('.', '{foo}') + normal 0sdVl call g:assert.equals(getline('.'), 'foo', 'failed at #144') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #144') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #144') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #144') - %delete - " #145 - call append(0, ['*', 'foo', '*']) - normal ggsd2j + call setline('.', '') + normal 0sdVl call g:assert.equals(getline('.'), 'foo', 'failed at #145') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #145') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #145') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #145') -endfunction -"}}} -function! s:suite.linewise_n_positioning() abort "{{{ + + %delete + " #146 - call append(0, ['(', 'foo', 'bar', 'baz', ')']) + call append(0, ['(', 'foo', ')']) normal ggsdVa( - call g:assert.equals(getline(1), 'foo', 'failed at #146') - call g:assert.equals(getline(2), 'bar', 'failed at #146') - call g:assert.equals(getline(3), 'baz', 'failed at #146') - call g:assert.equals(getline(4), '', 'failed at #146') + call g:assert.equals(getline('.'), 'foo', 'failed at #146') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #146') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #146') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #146') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #146') %delete " #147 - call append(0, ['foo', '(', 'bar', ')', 'baz']) - normal gg2jsdVa( - call g:assert.equals(getline(1), 'foo', 'failed at #147') - call g:assert.equals(getline(2), 'bar', 'failed at #147') - call g:assert.equals(getline(3), 'baz', 'failed at #147') - call g:assert.equals(getline(4), '', 'failed at #147') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #147') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #147') - call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #147') + call append(0, ['[', 'foo', ']']) + normal ggsdVa[ + call g:assert.equals(getline('.'), 'foo', 'failed at #147') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #147') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #147') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #147') %delete " #148 - call append(0, ['(foo', 'bar', 'baz)']) - normal ggsdVa( - call g:assert.equals(getline(1), 'foo', 'failed at #148') - call g:assert.equals(getline(2), 'bar', 'failed at #148') - call g:assert.equals(getline(3), 'baz', 'failed at #148') + call append(0, ['{', 'foo', '}']) + normal ggsdVa{ + call g:assert.equals(getline('.'), 'foo', 'failed at #148') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #148') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #148') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #148') -endfunction -"}}} -function! s:suite.linewise_n_a_character() abort "{{{ + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #148') + + %delete + " #149 - call setline('.', '(a)') - normal 0sdVa( - call g:assert.equals(getline('.'), 'a', 'failed at #149') + call append(0, ['<', 'foo', '>']) + normal ggsdVa< + call g:assert.equals(getline('.'), 'foo', 'failed at #149') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #149') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #149') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #149') - - %delete - + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #149') +endfunction +"}}} +function! s:suite.linewise_n_not_registered() abort "{{{ " #150 - call append(0, ['(', 'a', ')']) - normal ggsdVa( - call g:assert.equals(getline('.'), 'a', 'failed at #150') + call setline('.', 'afooa') + normal 0sdVl + call g:assert.equals(getline('.'), 'foo', 'failed at #150') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #150') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #150') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #150') - - %delete + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #150') " #151 - call append(0, ['(a', ')']) - normal ggsdVa( - call g:assert.equals(getline('.'), 'a', 'failed at #151') + call setline('.', '*foo*') + normal 0sdVl + call g:assert.equals(getline('.'), 'foo', 'failed at #151') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #151') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #151') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #151') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #151') %delete " #152 - call append(0, ['(', 'a)']) - normal ggsdVa( - call g:assert.equals(getline('.'), 'a', 'failed at #152') + call append(0, ['a', 'foo', 'a']) + normal ggsd2j + call g:assert.equals(getline('.'), 'foo', 'failed at #152') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #152') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #152') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #152') -endfunction -"}}} -function! s:suite.linewise_n_nothing_inside() abort "{{{ - " #153 - call setline('.', '()') - normal 0sdVl - call g:assert.equals(getline('.'), '', 'failed at #153') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #153') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #153') - call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #153') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #152') %delete + " #153 + call append(0, ['*', 'foo', '*']) + normal ggsd2j + call g:assert.equals(getline('.'), 'foo', 'failed at #153') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #153') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #153') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #153') +endfunction +"}}} +function! s:suite.linewise_n_positioning() abort "{{{ " #154 - call append(0, ['(', ')']) - normal ggsdj - call g:assert.equals(getline(1), '', 'failed at #154') + call append(0, ['(', 'foo', 'bar', 'baz', ')']) + normal ggsdVa( + call g:assert.equals(getline(1), 'foo', 'failed at #154') + call g:assert.equals(getline(2), 'bar', 'failed at #154') + call g:assert.equals(getline(3), 'baz', 'failed at #154') + call g:assert.equals(getline(4), '', 'failed at #154') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #154') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #154') - call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #154') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #154') + + %delete + + " #155 + call append(0, ['foo', '(', 'bar', ')', 'baz']) + normal gg2jsdVa( + call g:assert.equals(getline(1), 'foo', 'failed at #155') + call g:assert.equals(getline(2), 'bar', 'failed at #155') + call g:assert.equals(getline(3), 'baz', 'failed at #155') + call g:assert.equals(getline(4), '', 'failed at #155') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #155') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #155') + call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #155') + + %delete + + " #156 + call append(0, ['(foo', 'bar', 'baz)']) + normal ggsdVa( + call g:assert.equals(getline(1), 'foo', 'failed at #156') + call g:assert.equals(getline(2), 'bar', 'failed at #156') + call g:assert.equals(getline(3), 'baz', 'failed at #156') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #156') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #156') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #156') +endfunction +"}}} +function! s:suite.linewise_n_a_character() abort "{{{ + " #157 + call setline('.', '(a)') + normal 0sdVa( + call g:assert.equals(getline('.'), 'a', 'failed at #157') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #157') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #157') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #157') + + %delete + + " #158 + call append(0, ['(', 'a', ')']) + normal ggsdVa( + call g:assert.equals(getline('.'), 'a', 'failed at #158') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #158') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #158') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #158') + + %delete + + " #159 + call append(0, ['(a', ')']) + normal ggsdVa( + call g:assert.equals(getline('.'), 'a', 'failed at #159') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #159') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #159') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #159') + + %delete + + " #160 + call append(0, ['(', 'a)']) + normal ggsdVa( + call g:assert.equals(getline('.'), 'a', 'failed at #160') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #160') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #160') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #160') +endfunction +"}}} +function! s:suite.linewise_n_nothing_inside() abort "{{{ + " #161 + call setline('.', '()') + normal 0sdVl + call g:assert.equals(getline('.'), '', 'failed at #161') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #161') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #161') + call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #161') + + %delete + + " #162 + call append(0, ['(', ')']) + normal ggsdj + call g:assert.equals(getline(1), '', 'failed at #162') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #162') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #162') + call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #162') endfunction "}}} function! s:suite.linewise_n_breaking() abort "{{{ @@ -1926,89 +1970,89 @@ function! s:suite.linewise_n_breaking() abort "{{{ \ {'buns': ["bb\nbbb\nbb", "bb\nbbb\nbb"], 'input':['b']}, \ ] - " #155 + " #163 call append(0, ['aa', 'aaafooaaa', 'aa']) normal ggsd2j - call g:assert.equals(getline(1), 'foo', 'failed at #155') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #155') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #155') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #155') + call g:assert.equals(getline(1), 'foo', 'failed at #163') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #163') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #163') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #163') %delete - " #156 + " #164 call append(0, ['bb', 'bbb', 'bbfoobb', 'bbb', 'bb']) normal ggsd4j - call g:assert.equals(getline(1), 'foo', 'failed at #156') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #156') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #156') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #156') + call g:assert.equals(getline(1), 'foo', 'failed at #164') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #164') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #164') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #164') %delete - " #157 + " #165 call append(0, ['aa', 'aaa', 'aa', 'aaafooaaa', 'aa', 'aaa', 'aa']) normal gg2sd6j - call g:assert.equals(getline(1), 'foo', 'failed at #157') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #157') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #157') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #157') + call g:assert.equals(getline(1), 'foo', 'failed at #165') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #165') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #165') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #165') %delete - " #158 + " #166 call append(0, ['bb', 'bbb', 'bb', 'bb', 'bbb', 'bbfoobb', 'bbb', 'bb', 'bb', 'bbb', 'bb']) normal gg2sd10j - call g:assert.equals(getline(1), 'foo', 'failed at #158') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #158') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #158') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #158') + call g:assert.equals(getline(1), 'foo', 'failed at #166') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #166') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #166') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #166') endfunction "}}} function! s:suite.linewise_n_count() abort "{{{ - " #159 + " #167 call setline('.', '((foo))') normal 02sdV$ - call g:assert.equals(getline('.'), 'foo', 'failed at #159') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #159') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #159') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #159') + call g:assert.equals(getline('.'), 'foo', 'failed at #167') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #167') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #167') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #167') - " #160 + " #168 call setline('.', '{[(foo)]}') normal 03sdV$ - call g:assert.equals(getline('.'), 'foo', 'failed at #160') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #160') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #160') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #160') + call g:assert.equals(getline('.'), 'foo', 'failed at #168') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #168') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #168') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #168') - " #161 + " #169 call setline('.', '(foo)') normal 0sdV5l - call g:assert.equals(getline('.'), 'foo', 'failed at #161') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #161') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #161') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #161') + call g:assert.equals(getline('.'), 'foo', 'failed at #169') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #169') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #169') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #169') - " #162 + " #170 call setline('.', '[(foo bar)]') normal 02sdV11l - call g:assert.equals(getline('.'), 'foo bar', 'failed at #162') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #162') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #162') - call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #162') + call g:assert.equals(getline('.'), 'foo bar', 'failed at #170') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #170') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #170') + call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #170') %delete - " #163 + " #171 call append(0, ['foo', '{', '[', '(', 'bar', ')', ']', '}', 'baz']) normal ggj3sdV6j - call g:assert.equals(getline(1), 'foo', 'failed at #163') - call g:assert.equals(getline(2), 'bar', 'failed at #163') - call g:assert.equals(getline(3), 'baz', 'failed at #163') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #163') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #163') - call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #163') + call g:assert.equals(getline(1), 'foo', 'failed at #171') + call g:assert.equals(getline(2), 'bar', 'failed at #171') + call g:assert.equals(getline(3), 'baz', 'failed at #171') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #171') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #171') + call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #171') endfunction "}}} function! s:suite.linewise_n_external_textobj() abort"{{{ @@ -2020,23 +2064,23 @@ function! s:suite.linewise_n_external_textobj() abort"{{{ \ {'external': ['it', 'at']}, \ ] - " #164 + " #172 call setline('.', '{[(foo)]}') normal 0sdVl - call g:assert.equals(getline('.'), '[(foo)]', 'failed at #164') + call g:assert.equals(getline('.'), '[(foo)]', 'failed at #172') - " #165 + " #173 normal 0sdVl - call g:assert.equals(getline('.'), '(foo)', 'failed at #165') + call g:assert.equals(getline('.'), '(foo)', 'failed at #173') - " #166 + " #174 normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #166') + call g:assert.equals(getline('.'), 'foo', 'failed at #174') - " #167 + " #175 call setline('.', 'foo') normal 0sdV$ - call g:assert.equals(getline('.'), 'foo', 'failed at #167') + call g:assert.equals(getline('.'), 'foo', 'failed at #175') unlet g:sandwich#recipes unlet g:operator#sandwich#recipes @@ -2045,68 +2089,68 @@ endfunction function! s:suite.linewise_n_option_cursor() abort "{{{ """"" cursor """ inner_head - " #168 + " #176 call setline('.', '(((foo)))') normal 0l2sdVl - call g:assert.equals(getline('.'), '(foo)', 'failed at #168') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #168') + call g:assert.equals(getline('.'), '(foo)', 'failed at #176') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #176') - " #169 + " #177 normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #169') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #169') + call g:assert.equals(getline('.'), 'foo', 'failed at #177') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #177') """ keep - " #170 + " #178 call operator#sandwich#set('delete', 'line', 'cursor', 'keep') call setline('.', '(((foo)))') normal 03l2sdVl - call g:assert.equals(getline('.'), '(foo)', 'failed at #170') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #170') + call g:assert.equals(getline('.'), '(foo)', 'failed at #178') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #178') - " #171 + " #179 normal lsdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #171') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #171') + call g:assert.equals(getline('.'), 'foo', 'failed at #179') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #179') """ inner_tail - " #172 + " #180 call operator#sandwich#set('delete', 'line', 'cursor', 'inner_tail') call setline('.', '(((foo)))') normal 02sdVl - call g:assert.equals(getline('.'), '(foo)', 'failed at #172') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #172') + call g:assert.equals(getline('.'), '(foo)', 'failed at #180') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #180') - " #173 + " #181 normal 2hsdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #173') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #173') + call g:assert.equals(getline('.'), 'foo', 'failed at #181') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #181') """ head - " #174 + " #182 call operator#sandwich#set('delete', 'line', 'cursor', 'head') call setline('.', '(((foo)))') normal 02sdVl - call g:assert.equals(getline('.'), '(foo)', 'failed at #174') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #174') + call g:assert.equals(getline('.'), '(foo)', 'failed at #182') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #182') - " #175 + " #183 normal 3lsdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #175') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #175') + call g:assert.equals(getline('.'), 'foo', 'failed at #183') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #183') """ tail - " #176 + " #184 call operator#sandwich#set('delete', 'line', 'cursor', 'tail') call setline('.', '(((foo)))') normal 02sdVl - call g:assert.equals(getline('.'), '(foo)', 'failed at #176') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #176') + call g:assert.equals(getline('.'), '(foo)', 'failed at #184') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #184') - " #177 + " #185 normal 3hsdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #177') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #177') + call g:assert.equals(getline('.'), 'foo', 'failed at #185') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #185') call operator#sandwich#set('delete', 'line', 'cursor', 'inner_head') endfunction @@ -2119,27 +2163,27 @@ function! s:suite.linewise_n_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #178 + " #186 call setline('.', '{(foo)}') normal 0sdVl - call g:assert.equals(getline('.'), '(foo)', 'failed at #178') + call g:assert.equals(getline('.'), '(foo)', 'failed at #186') - " #179 + " #187 call setline('.', '({foo})') normal 0sdVl - call g:assert.equals(getline('.'), '({foo})', 'failed at #179') + call g:assert.equals(getline('.'), '({foo})', 'failed at #187') """ off - " #180 + " #188 call operator#sandwich#set('delete', 'line', 'noremap', 0) call setline('.', '{(foo)}') normal 0sdVl - call g:assert.equals(getline('.'), '{(foo)}', 'failed at #180') + call g:assert.equals(getline('.'), '{(foo)}', 'failed at #188') - " #181 + " #189 call setline('.', '({foo})') normal 0sdVl - call g:assert.equals(getline('.'), '{foo}', 'failed at #181') + call g:assert.equals(getline('.'), '{foo}', 'failed at #189') unlet! g:sandwich#recipes unlet! g:operator#sandwich#recipes @@ -2153,27 +2197,27 @@ function! s:suite.linewise_n_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #182 + " #190 call setline('.', '\d\+foo\d\+') normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #182') + call g:assert.equals(getline('.'), 'foo', 'failed at #190') - " #183 + " #191 call setline('.', '888foo888') normal 0sdVl - call g:assert.equals(getline('.'), '88foo88', 'failed at #183') + call g:assert.equals(getline('.'), '88foo88', 'failed at #191') """ on call operator#sandwich#set('delete', 'line', 'regex', 1) - " #184 + " #192 call setline('.', '\d\+foo\d\+') normal 0sdVl - call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #184') + call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #192') - " #185 + " #193 call setline('.', '888foo888') normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #185') + call g:assert.equals(getline('.'), 'foo', 'failed at #193') call operator#sandwich#set('delete', 'line', 'regex', 0) unlet! g:sandwich#recipes @@ -2181,67 +2225,89 @@ function! s:suite.linewise_n_option_regex() abort "{{{ endfunction "}}} function! s:suite.linewise_n_option_skip_space() abort "{{{ - """ on - " #186 + """ 2 + " #194 call setline('.', '"foo"') normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #186') + call g:assert.equals(getline('.'), 'foo', 'failed at #194') - " #187 + " #195 call setline('.', ' "foo"') normal 0sdVl - call g:assert.equals(getline('.'), ' foo', 'failed at #187') + call g:assert.equals(getline('.'), ' foo', 'failed at #195') - " #188 + " #196 call setline('.', '"foo" ') normal 0sdVl - call g:assert.equals(getline('.'), 'foo ', 'failed at #188') + call g:assert.equals(getline('.'), 'foo ', 'failed at #196') - " #189 + " #197 + call setline('.', ' "foo" ') + normal 0sdVl + call g:assert.equals(getline('.'), ' foo ', 'failed at #197') + + """ 1 + call operator#sandwich#set('delete', 'line', 'skip_space', 1) + " #198 + call setline('.', '"foo"') + normal 0sdVl + call g:assert.equals(getline('.'), 'foo', 'failed at #198') + + " #199 + call setline('.', ' "foo"') + normal 0sdVl + call g:assert.equals(getline('.'), ' foo', 'failed at #199') + + " #200 + call setline('.', '"foo" ') + normal 0sdVl + call g:assert.equals(getline('.'), 'foo ', 'failed at #200') + + " #201 " do not skip! call setline('.', ' "foo" ') normal 0sdVl - call g:assert.equals(getline('.'), '"foo"', 'failed at #189') + call g:assert.equals(getline('.'), '"foo"', 'failed at #201') - """ off + """ 0 call operator#sandwich#set('delete', 'line', 'skip_space', 0) - " #190 + " #202 call setline('.', '"foo"') normal 0sdVl - call g:assert.equals(getline('.'), 'foo', 'failed at #190') + call g:assert.equals(getline('.'), 'foo', 'failed at #202') - " #191 + " #203 call setline('.', ' "foo"') normal 0sdVl - call g:assert.equals(getline('.'), ' "foo"', 'failed at #191') + call g:assert.equals(getline('.'), ' "foo"', 'failed at #203') - " #192 + " #204 call setline('.', '"foo" ') normal 0sdVl - call g:assert.equals(getline('.'), '"foo" ', 'failed at #192') + call g:assert.equals(getline('.'), '"foo" ', 'failed at #204') - " #193 + " #205 " do not skip! call setline('.', ' "foo" ') normal 0sdVl - call g:assert.equals(getline('.'), '"foo"', 'failed at #193') + call g:assert.equals(getline('.'), '"foo"', 'failed at #205') call operator#sandwich#set('delete', 'line', 'skip_space', 1) endfunction "}}} function! s:suite.linewise_n_option_skip_char() abort "{{{ """ off - " #194 + " #206 call setline('.', 'aa(foo)bb') normal 0sdVl - call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #194') + call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #206') """ on call operator#sandwich#set('delete', 'line', 'skip_char', 1) - " #195 + " #207 call setline('.', 'aa(foo)bb') normal 0sdVl - call g:assert.equals(getline('.'), 'aafoobb', 'failed at #195') + call g:assert.equals(getline('.'), 'aafoobb', 'failed at #207') call operator#sandwich#set('delete', 'line', 'skip_char', 0) endfunction @@ -2249,10 +2315,10 @@ endfunction function! s:suite.linewise_n_option_command() abort "{{{ call operator#sandwich#set('delete', 'line', 'command', ['normal! `[dv`]']) - " #196 + " #208 call setline('.', '(foo)') normal 0sdVl - call g:assert.equals(getline('.'), '', 'failed at #196') + call g:assert.equals(getline('.'), '', 'failed at #208') call operator#sandwich#set('delete', 'line', 'command', []) endfunction @@ -2261,199 +2327,84 @@ function! s:suite.linewise_n_option_linewise() abort "{{{ call operator#sandwich#set('delete', 'line', 'linewise', 0) """ 0 - " #197 + " #209 call append(0, ['(', 'foo', ')']) normal ggsd2j - call g:assert.equals(getline(1), '', 'failed at #197') - call g:assert.equals(getline(2), 'foo', 'failed at #197') - call g:assert.equals(getline(3), '', 'failed at #197') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #197') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #197') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #197') + call g:assert.equals(getline(1), '', 'failed at #209') + call g:assert.equals(getline(2), 'foo', 'failed at #209') + call g:assert.equals(getline(3), '', 'failed at #209') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #209') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #209') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #209') %delete - " #198 + " #210 call append(0, ['( ', 'foo', ' )']) normal ggsd2j - call g:assert.equals(getline(1), ' ', 'failed at #198') - call g:assert.equals(getline(2), 'foo', 'failed at #198') - call g:assert.equals(getline(3), ' ', 'failed at #198') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #198') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #198') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #198') + call g:assert.equals(getline(1), ' ', 'failed at #210') + call g:assert.equals(getline(2), 'foo', 'failed at #210') + call g:assert.equals(getline(3), ' ', 'failed at #210') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #210') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #210') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #210') %delete - " #199 + " #211 call append(0, ['(aa', 'foo', 'aa)']) normal ggsd2j - call g:assert.equals(getline(1), 'aa', 'failed at #199') - call g:assert.equals(getline(2), 'foo', 'failed at #199') - call g:assert.equals(getline(3), 'aa', 'failed at #199') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #199') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #199') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #199') + call g:assert.equals(getline(1), 'aa', 'failed at #211') + call g:assert.equals(getline(2), 'foo', 'failed at #211') + call g:assert.equals(getline(3), 'aa', 'failed at #211') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #211') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #211') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #211') %delete - " #200 + " #212 call append(0, ['(aa', 'foo', ')']) normal ggsd2j - call g:assert.equals(getline(1), 'aa', 'failed at #200') - call g:assert.equals(getline(2), 'foo', 'failed at #200') - call g:assert.equals(getline(3), '', 'failed at #200') - call g:assert.equals(getline(4), '', 'failed at #200') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #200') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #200') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #200') + call g:assert.equals(getline(1), 'aa', 'failed at #212') + call g:assert.equals(getline(2), 'foo', 'failed at #212') + call g:assert.equals(getline(3), '', 'failed at #212') + call g:assert.equals(getline(4), '', 'failed at #212') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #212') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #212') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #212') %delete - " #201 + " #213 call append(0, ['(', 'foo', 'aa)']) normal ggsd2j - call g:assert.equals(getline(1), '', 'failed at #201') - call g:assert.equals(getline(2), 'foo', 'failed at #201') - call g:assert.equals(getline(3), 'aa', 'failed at #201') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #201') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #201') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #201') + call g:assert.equals(getline(1), '', 'failed at #213') + call g:assert.equals(getline(2), 'foo', 'failed at #213') + call g:assert.equals(getline(3), 'aa', 'failed at #213') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #213') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #213') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #213') %delete call operator#sandwich#set('delete', 'line', 'linewise', 2) """ 2 - " #202 - call append(0, ['(', 'foo', ')']) - normal ggsd2j - call g:assert.equals(getline(1), 'foo', 'failed at #202') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #202') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #202') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #202') - - %delete - - " #203 - call append(0, ['( ', 'foo', ' )']) - normal ggsd2j - call g:assert.equals(getline(1), 'foo', 'failed at #203') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #203') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #203') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #203') - - %delete - - " #204 - call append(0, ['(aa', 'foo', 'aa)']) - normal ggsd2j - call g:assert.equals(getline(1), 'foo', 'failed at #204') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #204') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #204') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #204') - - %delete - - " #205 - call append(0, ['aa', '(foo)', 'bb']) - normal ggjsdVl - call g:assert.equals(getline(1), 'aa', 'failed at #205') - call g:assert.equals(getline(2), 'bb', 'failed at #205') - call g:assert.equals(getline(3), '', 'failed at #205') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #205') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #205') - call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #205') -endfunction -"}}} - -function! s:suite.linewise_x_default_recipes() abort "{{{ - " #206 - call setline('.', '(foo)') - normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #206') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #206') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #206') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #206') - - " #207 - call setline('.', '[foo]') - normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #207') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #207') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #207') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #207') - - " #208 - call setline('.', '{foo}') - normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #208') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #208') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #208') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #208') - - " #209 - call setline('.', '') - normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #209') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #209') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #209') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #209') - - %delete - - " #210 - call append(0, ['(', 'foo', ')']) - normal ggV2jsd - call g:assert.equals(getline('.'), 'foo', 'failed at #210') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #210') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #210') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #210') - - %delete - - " #211 - call append(0, ['[', 'foo', ']']) - normal ggV2jsd - call g:assert.equals(getline('.'), 'foo', 'failed at #211') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #211') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #211') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #211') - - %delete - - " #212 - call append(0, ['{', 'foo', '}']) - normal ggV2jsd - call g:assert.equals(getline('.'), 'foo', 'failed at #212') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #212') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #212') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #212') - - %delete - - " #213 - call append(0, ['<', 'foo', '>']) - normal ggV2jsd - call g:assert.equals(getline('.'), 'foo', 'failed at #213') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #213') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #213') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #213') -endfunction -"}}} -function! s:suite.linewise_x_not_registered() abort "{{{ " #214 - call setline('.', 'afooa') - normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #214') + call append(0, ['(', 'foo', ')']) + normal ggsd2j + call g:assert.equals(getline(1), 'foo', 'failed at #214') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #214') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #214') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #214') + %delete + " #215 - call setline('.', '*foo*') - normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #215') + call append(0, ['( ', 'foo', ' )']) + normal ggsd2j + call g:assert.equals(getline(1), 'foo', 'failed at #215') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #215') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #215') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #215') @@ -2461,9 +2412,9 @@ function! s:suite.linewise_x_not_registered() abort "{{{ %delete " #216 - call append(0, ['a', 'foo', 'a']) - normal ggV2jsd - call g:assert.equals(getline('.'), 'foo', 'failed at #216') + call append(0, ['(aa', 'foo', 'aa)']) + normal ggsd2j + call g:assert.equals(getline(1), 'foo', 'failed at #216') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #216') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #216') call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #216') @@ -2471,110 +2422,225 @@ function! s:suite.linewise_x_not_registered() abort "{{{ %delete " #217 - call append(0, ['*', 'foo', '*']) - normal ggV2jsd - call g:assert.equals(getline('.'), 'foo', 'failed at #217') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #217') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #217') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #217') + call append(0, ['aa', '(foo)', 'bb']) + normal ggjsdVl + call g:assert.equals(getline(1), 'aa', 'failed at #217') + call g:assert.equals(getline(2), 'bb', 'failed at #217') + call g:assert.equals(getline(3), '', 'failed at #217') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #217') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #217') + call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #217') endfunction "}}} -function! s:suite.linewise_x_positioning() abort "{{{ + +function! s:suite.linewise_x_default_recipes() abort "{{{ " #218 - call append(0, ['(', 'foo', 'bar', 'baz', ')']) - normal ggV4jsd - call g:assert.equals(getline(1), 'foo', 'failed at #218') - call g:assert.equals(getline(2), 'bar', 'failed at #218') - call g:assert.equals(getline(3), 'baz', 'failed at #218') - call g:assert.equals(getline(4), '', 'failed at #218') + call setline('.', '(foo)') + normal 0Vsd + call g:assert.equals(getline('.'), 'foo', 'failed at #218') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #218') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #218') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #218') - - %delete + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #218') " #219 - call append(0, ['foo', '(', 'bar', ')', 'baz']) - normal ggjV2jsd - call g:assert.equals(getline(1), 'foo', 'failed at #219') - call g:assert.equals(getline(2), 'bar', 'failed at #219') - call g:assert.equals(getline(3), 'baz', 'failed at #219') - call g:assert.equals(getline(4), '', 'failed at #219') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #219') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #219') - call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #219') - - %delete + call setline('.', '[foo]') + normal 0Vsd + call g:assert.equals(getline('.'), 'foo', 'failed at #219') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #219') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #219') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #219') " #220 - call append(0, ['(foo', 'bar', 'baz)']) - normal ggV2jsd - call g:assert.equals(getline(1), 'foo', 'failed at #220') - call g:assert.equals(getline(2), 'bar', 'failed at #220') - call g:assert.equals(getline(3), 'baz', 'failed at #220') + call setline('.', '{foo}') + normal 0Vsd + call g:assert.equals(getline('.'), 'foo', 'failed at #220') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #220') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #220') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #220') -endfunction -"}}} -function! s:suite.linewise_x_a_character() abort "{{{ + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #220') + " #221 - call setline('.', '(a)') + call setline('.', '') normal 0Vsd - call g:assert.equals(getline('.'), 'a', 'failed at #221') + call g:assert.equals(getline('.'), 'foo', 'failed at #221') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #221') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #221') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #221') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #221') %delete " #222 - call append(0, ['(', 'a', ')']) + call append(0, ['(', 'foo', ')']) normal ggV2jsd - call g:assert.equals(getline('.'), 'a', 'failed at #222') + call g:assert.equals(getline('.'), 'foo', 'failed at #222') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #222') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #222') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #222') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #222') %delete " #223 - call append(0, ['(a', ')']) - normal ggVjsd - call g:assert.equals(getline('.'), 'a', 'failed at #223') + call append(0, ['[', 'foo', ']']) + normal ggV2jsd + call g:assert.equals(getline('.'), 'foo', 'failed at #223') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #223') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #223') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #223') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #223') %delete " #224 - call append(0, ['(', 'a)']) - normal ggVjsd - call g:assert.equals(getline('.'), 'a', 'failed at #224') + call append(0, ['{', 'foo', '}']) + normal ggV2jsd + call g:assert.equals(getline('.'), 'foo', 'failed at #224') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #224') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #224') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #224') -endfunction -"}}} -function! s:suite.linewise_x_nothing_inside() abort "{{{ - " #153 - call setline('.', '()') - normal 0Vsd - call g:assert.equals(getline('.'), '', 'failed at #153') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #153') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #153') - call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #153') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #224') %delete - " #154 + " #225 + call append(0, ['<', 'foo', '>']) + normal ggV2jsd + call g:assert.equals(getline('.'), 'foo', 'failed at #225') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #225') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #225') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #225') +endfunction +"}}} +function! s:suite.linewise_x_not_registered() abort "{{{ + " #226 + call setline('.', 'afooa') + normal 0Vsd + call g:assert.equals(getline('.'), 'foo', 'failed at #226') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #226') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #226') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #226') + + " #227 + call setline('.', '*foo*') + normal 0Vsd + call g:assert.equals(getline('.'), 'foo', 'failed at #227') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #227') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #227') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #227') + + %delete + + " #228 + call append(0, ['a', 'foo', 'a']) + normal ggV2jsd + call g:assert.equals(getline('.'), 'foo', 'failed at #228') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #228') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #228') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #228') + + %delete + + " #229 + call append(0, ['*', 'foo', '*']) + normal ggV2jsd + call g:assert.equals(getline('.'), 'foo', 'failed at #229') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #229') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #229') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #229') +endfunction +"}}} +function! s:suite.linewise_x_positioning() abort "{{{ + " #230 + call append(0, ['(', 'foo', 'bar', 'baz', ')']) + normal ggV4jsd + call g:assert.equals(getline(1), 'foo', 'failed at #230') + call g:assert.equals(getline(2), 'bar', 'failed at #230') + call g:assert.equals(getline(3), 'baz', 'failed at #230') + call g:assert.equals(getline(4), '', 'failed at #230') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #230') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #230') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #230') + + %delete + + " #231 + call append(0, ['foo', '(', 'bar', ')', 'baz']) + normal ggjV2jsd + call g:assert.equals(getline(1), 'foo', 'failed at #231') + call g:assert.equals(getline(2), 'bar', 'failed at #231') + call g:assert.equals(getline(3), 'baz', 'failed at #231') + call g:assert.equals(getline(4), '', 'failed at #231') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #231') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #231') + call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #231') + + %delete + + " #232 + call append(0, ['(foo', 'bar', 'baz)']) + normal ggV2jsd + call g:assert.equals(getline(1), 'foo', 'failed at #232') + call g:assert.equals(getline(2), 'bar', 'failed at #232') + call g:assert.equals(getline(3), 'baz', 'failed at #232') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #232') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #232') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #232') +endfunction +"}}} +function! s:suite.linewise_x_a_character() abort "{{{ + " #233 + call setline('.', '(a)') + normal 0Vsd + call g:assert.equals(getline('.'), 'a', 'failed at #233') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #233') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #233') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #233') + + %delete + + " #234 + call append(0, ['(', 'a', ')']) + normal ggV2jsd + call g:assert.equals(getline('.'), 'a', 'failed at #234') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #234') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #234') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #234') + + %delete + + " #235 + call append(0, ['(a', ')']) + normal ggVjsd + call g:assert.equals(getline('.'), 'a', 'failed at #235') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #235') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #235') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #235') + + %delete + + " #236 + call append(0, ['(', 'a)']) + normal ggVjsd + call g:assert.equals(getline('.'), 'a', 'failed at #236') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #236') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #236') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #236') +endfunction +"}}} +function! s:suite.linewise_x_nothing_inside() abort "{{{ + " #165 + call setline('.', '()') + normal 0Vsd + call g:assert.equals(getline('.'), '', 'failed at #165') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #165') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #165') + call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #165') + + %delete + + " #166 call append(0, ['(', ')']) normal ggVjsd - call g:assert.equals(getline(1), '', 'failed at #154') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #154') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #154') - call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #154') + call g:assert.equals(getline(1), '', 'failed at #166') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #166') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #166') + call g:assert.equals(getpos("']"), [0, 1, 1, 0], 'failed at #166') endfunction "}}} function! s:suite.linewise_x_breaking() abort "{{{ @@ -2583,89 +2649,89 @@ function! s:suite.linewise_x_breaking() abort "{{{ \ {'buns': ["bb\nbbb\nbb", "bb\nbbb\nbb"], 'input':['b']}, \ ] - " #225 + " #237 call append(0, ['aa', 'aaafooaaa', 'aa']) normal ggsdV2j - call g:assert.equals(getline(1), 'foo', 'failed at #225') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #225') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #225') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #225') + call g:assert.equals(getline(1), 'foo', 'failed at #237') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #237') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #237') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #237') %delete - " #226 + " #238 call append(0, ['bb', 'bbb', 'bbfoobb', 'bbb', 'bb']) normal ggsdV4j - call g:assert.equals(getline(1), 'foo', 'failed at #226') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #226') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #226') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #226') + call g:assert.equals(getline(1), 'foo', 'failed at #238') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #238') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #238') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #238') %delete - " #227 + " #239 call append(0, ['aa', 'aaa', 'aa', 'aaafooaaa', 'aa', 'aaa', 'aa']) normal gg2sdV6j - call g:assert.equals(getline(1), 'foo', 'failed at #227') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #227') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #227') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #227') + call g:assert.equals(getline(1), 'foo', 'failed at #239') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #239') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #239') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #239') %delete - " #228 + " #240 call append(0, ['bb', 'bbb', 'bb', 'bb', 'bbb', 'bbfoobb', 'bbb', 'bb', 'bb', 'bbb', 'bb']) normal gg2sdV10j - call g:assert.equals(getline(1), 'foo', 'failed at #228') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #228') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #228') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #228') + call g:assert.equals(getline(1), 'foo', 'failed at #240') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #240') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #240') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #240') endfunction "}}} function! s:suite.linewise_x_count() abort "{{{ - " #229 + " #241 call setline('.', '((foo))') normal 0V2sd - call g:assert.equals(getline('.'), 'foo', 'failed at #229') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #229') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #229') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #229') + call g:assert.equals(getline('.'), 'foo', 'failed at #241') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #241') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #241') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #241') - " #230 + " #242 call setline('.', '{[(foo)]}') normal 0V3sd - call g:assert.equals(getline('.'), 'foo', 'failed at #230') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #230') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #230') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #230') + call g:assert.equals(getline('.'), 'foo', 'failed at #242') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #242') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #242') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #242') - " #231 + " #243 call setline('.', '(foo)') normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #231') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #231') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #231') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #231') + call g:assert.equals(getline('.'), 'foo', 'failed at #243') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #243') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #243') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #243') - " #232 + " #244 call setline('.', '[(foo bar)]') normal 0V2sd - call g:assert.equals(getline('.'), 'foo bar', 'failed at #232') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #232') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #232') - call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #232') + call g:assert.equals(getline('.'), 'foo bar', 'failed at #244') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #244') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #244') + call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #244') %delete - " #233 + " #245 call append(0, ['foo', '{', '[', '(', 'bar', ')', ']', '}', 'baz']) normal ggjV6j3sd - call g:assert.equals(getline(1), 'foo', 'failed at #233') - call g:assert.equals(getline(2), 'bar', 'failed at #233') - call g:assert.equals(getline(3), 'baz', 'failed at #233') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #233') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #233') - call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #233') + call g:assert.equals(getline(1), 'foo', 'failed at #245') + call g:assert.equals(getline(2), 'bar', 'failed at #245') + call g:assert.equals(getline(3), 'baz', 'failed at #245') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #245') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #245') + call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #245') endfunction "}}} function! s:suite.linewise_x_external_textobj() abort"{{{ @@ -2677,23 +2743,23 @@ function! s:suite.linewise_x_external_textobj() abort"{{{ \ {'external': ['it', 'at']}, \ ] - " #234 + " #246 call setline('.', '{[(foo)]}') normal 0Vsd - call g:assert.equals(getline('.'), '[(foo)]', 'failed at #234') + call g:assert.equals(getline('.'), '[(foo)]', 'failed at #246') - " #235 + " #247 normal 0Vsd - call g:assert.equals(getline('.'), '(foo)', 'failed at #235') + call g:assert.equals(getline('.'), '(foo)', 'failed at #247') - " #236 + " #248 normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #236') + call g:assert.equals(getline('.'), 'foo', 'failed at #248') - " #237 + " #249 call setline('.', 'foo') normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #237') + call g:assert.equals(getline('.'), 'foo', 'failed at #249') unlet g:sandwich#recipes unlet g:operator#sandwich#recipes @@ -2702,68 +2768,68 @@ endfunction function! s:suite.linewise_x_option_cursor() abort "{{{ """"" cursor """ inner_head - " #238 + " #250 call setline('.', '(((foo)))') normal 0lV2sd - call g:assert.equals(getline('.'), '(foo)', 'failed at #238') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #238') + call g:assert.equals(getline('.'), '(foo)', 'failed at #250') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #250') - " #239 + " #251 normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #239') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #239') + call g:assert.equals(getline('.'), 'foo', 'failed at #251') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #251') """ keep - " #240 + " #252 call operator#sandwich#set('delete', 'line', 'cursor', 'keep') call setline('.', '(((foo)))') normal 03lV2sd - call g:assert.equals(getline('.'), '(foo)', 'failed at #240') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #240') + call g:assert.equals(getline('.'), '(foo)', 'failed at #252') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #252') - " #241 + " #253 normal lVsd - call g:assert.equals(getline('.'), 'foo', 'failed at #241') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #241') + call g:assert.equals(getline('.'), 'foo', 'failed at #253') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #253') """ inner_tail - " #242 + " #254 call operator#sandwich#set('delete', 'line', 'cursor', 'inner_tail') call setline('.', '(((foo)))') normal 0V2sd - call g:assert.equals(getline('.'), '(foo)', 'failed at #242') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #242') + call g:assert.equals(getline('.'), '(foo)', 'failed at #254') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #254') - " #243 + " #255 normal 2hVsd - call g:assert.equals(getline('.'), 'foo', 'failed at #243') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #243') + call g:assert.equals(getline('.'), 'foo', 'failed at #255') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #255') """ head - " #244 + " #256 call operator#sandwich#set('delete', 'line', 'cursor', 'head') call setline('.', '(((foo)))') normal 0V2sd - call g:assert.equals(getline('.'), '(foo)', 'failed at #244') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #244') + call g:assert.equals(getline('.'), '(foo)', 'failed at #256') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #256') - " #245 + " #257 normal 3lVsd - call g:assert.equals(getline('.'), 'foo', 'failed at #245') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #245') + call g:assert.equals(getline('.'), 'foo', 'failed at #257') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #257') """ tail - " #246 + " #258 call operator#sandwich#set('delete', 'line', 'cursor', 'tail') call setline('.', '(((foo)))') normal 0V2sd - call g:assert.equals(getline('.'), '(foo)', 'failed at #246') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #246') + call g:assert.equals(getline('.'), '(foo)', 'failed at #258') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #258') - " #247 + " #259 normal 3hVsd - call g:assert.equals(getline('.'), 'foo', 'failed at #247') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #247') + call g:assert.equals(getline('.'), 'foo', 'failed at #259') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #259') call operator#sandwich#set('delete', 'line', 'cursor', 'inner_head') endfunction @@ -2776,27 +2842,27 @@ function! s:suite.linewise_x_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #248 + " #260 call setline('.', '{(foo)}') normal 0Vsd - call g:assert.equals(getline('.'), '(foo)', 'failed at #248') + call g:assert.equals(getline('.'), '(foo)', 'failed at #260') - " #249 + " #261 call setline('.', '({foo})') normal 0Vsd - call g:assert.equals(getline('.'), '({foo})', 'failed at #249') + call g:assert.equals(getline('.'), '({foo})', 'failed at #261') """ off - " #250 + " #262 call operator#sandwich#set('delete', 'line', 'noremap', 0) call setline('.', '{(foo)}') normal 0Vsd - call g:assert.equals(getline('.'), '{(foo)}', 'failed at #250') + call g:assert.equals(getline('.'), '{(foo)}', 'failed at #262') - " #251 + " #263 call setline('.', '({foo})') normal 0Vsd - call g:assert.equals(getline('.'), '{foo}', 'failed at #251') + call g:assert.equals(getline('.'), '{foo}', 'failed at #263') unlet! g:sandwich#recipes unlet! g:operator#sandwich#recipes @@ -2810,27 +2876,27 @@ function! s:suite.linewise_x_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #252 + " #264 call setline('.', '\d\+foo\d\+') normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #252') + call g:assert.equals(getline('.'), 'foo', 'failed at #264') - " #253 + " #265 call setline('.', '888foo888') normal 0Vsd - call g:assert.equals(getline('.'), '88foo88', 'failed at #253') + call g:assert.equals(getline('.'), '88foo88', 'failed at #265') """ on call operator#sandwich#set('delete', 'line', 'regex', 1) - " #254 + " #266 call setline('.', '\d\+foo\d\+') normal 0Vsd - call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #254') + call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #266') - " #255 + " #267 call setline('.', '888foo888') normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #255') + call g:assert.equals(getline('.'), 'foo', 'failed at #267') call operator#sandwich#set('delete', 'line', 'regex', 0) unlet! g:sandwich#recipes @@ -2838,67 +2904,89 @@ function! s:suite.linewise_x_option_regex() abort "{{{ endfunction "}}} function! s:suite.linewise_x_option_skip_space() abort "{{{ - """ on - " #256 + """ 2 + " #268 call setline('.', '"foo"') normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #256') + call g:assert.equals(getline('.'), 'foo', 'failed at #268') - " #257 + " #269 call setline('.', ' "foo"') normal 0Vsd - call g:assert.equals(getline('.'), ' foo', 'failed at #257') + call g:assert.equals(getline('.'), ' foo', 'failed at #269') - " #258 + " #270 call setline('.', '"foo" ') normal 0Vsd - call g:assert.equals(getline('.'), 'foo ', 'failed at #258') + call g:assert.equals(getline('.'), 'foo ', 'failed at #270') - " #259 + " #271 + call setline('.', ' "foo" ') + normal 0Vsd + call g:assert.equals(getline('.'), ' foo ', 'failed at #271') + + """ 1 + call operator#sandwich#set('delete', 'line', 'skip_space', 1) + " #272 + call setline('.', '"foo"') + normal 0Vsd + call g:assert.equals(getline('.'), 'foo', 'failed at #272') + + " #273 + call setline('.', ' "foo"') + normal 0Vsd + call g:assert.equals(getline('.'), ' foo', 'failed at #273') + + " #274 + call setline('.', '"foo" ') + normal 0Vsd + call g:assert.equals(getline('.'), 'foo ', 'failed at #274') + + " #275 " do not skip! call setline('.', ' "foo" ') normal 0Vsd - call g:assert.equals(getline('.'), '"foo"', 'failed at #259') + call g:assert.equals(getline('.'), '"foo"', 'failed at #275') - """ off + """ 0 call operator#sandwich#set('delete', 'line', 'skip_space', 0) - " #260 + " #276 call setline('.', '"foo"') normal 0Vsd - call g:assert.equals(getline('.'), 'foo', 'failed at #260') + call g:assert.equals(getline('.'), 'foo', 'failed at #276') - " #261 + " #277 call setline('.', ' "foo"') normal 0Vsd - call g:assert.equals(getline('.'), ' "foo"', 'failed at #261') + call g:assert.equals(getline('.'), ' "foo"', 'failed at #277') - " #262 + " #278 call setline('.', '"foo" ') normal 0Vsd - call g:assert.equals(getline('.'), '"foo" ', 'failed at #262') + call g:assert.equals(getline('.'), '"foo" ', 'failed at #278') - " #263 + " #279 " do not skip! call setline('.', ' "foo" ') normal 0Vsd - call g:assert.equals(getline('.'), '"foo"', 'failed at #263') + call g:assert.equals(getline('.'), '"foo"', 'failed at #279') call operator#sandwich#set('delete', 'line', 'skip_space', 1) endfunction "}}} function! s:suite.linewise_x_option_skip_char() abort "{{{ """ off - " #264 + " #280 call setline('.', 'aa(foo)bb') normal 0Vsd - call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #264') + call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #280') """ on call operator#sandwich#set('delete', 'line', 'skip_char', 1) - " #265 + " #281 call setline('.', 'aa(foo)bb') normal 0Vsd - call g:assert.equals(getline('.'), 'aafoobb', 'failed at #265') + call g:assert.equals(getline('.'), 'aafoobb', 'failed at #281') call operator#sandwich#set('delete', 'line', 'skip_char', 0) endfunction @@ -2906,10 +2994,10 @@ endfunction function! s:suite.linewise_x_option_command() abort "{{{ call operator#sandwich#set('delete', 'line', 'command', ['normal! `[dv`]']) - " #266 + " #282 call setline('.', '(foo)') normal 0Vsd - call g:assert.equals(getline('.'), '', 'failed at #266') + call g:assert.equals(getline('.'), '', 'failed at #282') call operator#sandwich#set('delete', 'line', 'command', []) endfunction @@ -2918,109 +3006,109 @@ function! s:suite.linewise_x_option_linewise() abort "{{{ call operator#sandwich#set('delete', 'line', 'linewise', 0) """ 0 - " #267 + " #283 call append(0, ['(', 'foo', ')']) normal ggV2jsd - call g:assert.equals(getline(1), '', 'failed at #267') - call g:assert.equals(getline(2), 'foo', 'failed at #267') - call g:assert.equals(getline(3), '', 'failed at #267') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #267') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #267') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #267') + call g:assert.equals(getline(1), '', 'failed at #283') + call g:assert.equals(getline(2), 'foo', 'failed at #283') + call g:assert.equals(getline(3), '', 'failed at #283') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #283') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #283') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #283') %delete - " #268 + " #284 call append(0, ['( ', 'foo', ' )']) normal ggV2jsd - call g:assert.equals(getline(1), ' ', 'failed at #268') - call g:assert.equals(getline(2), 'foo', 'failed at #268') - call g:assert.equals(getline(3), ' ', 'failed at #268') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #268') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #268') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #268') + call g:assert.equals(getline(1), ' ', 'failed at #284') + call g:assert.equals(getline(2), 'foo', 'failed at #284') + call g:assert.equals(getline(3), ' ', 'failed at #284') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #284') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #284') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #284') %delete - " #269 + " #285 call append(0, ['(aa', 'foo', 'aa)']) normal ggV2jsd - call g:assert.equals(getline(1), 'aa', 'failed at #269') - call g:assert.equals(getline(2), 'foo', 'failed at #269') - call g:assert.equals(getline(3), 'aa', 'failed at #269') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #269') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #269') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #269') + call g:assert.equals(getline(1), 'aa', 'failed at #285') + call g:assert.equals(getline(2), 'foo', 'failed at #285') + call g:assert.equals(getline(3), 'aa', 'failed at #285') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #285') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #285') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #285') %delete - " #270 + " #286 call append(0, ['(aa', 'foo', ')']) normal ggV2jsd - call g:assert.equals(getline(1), 'aa', 'failed at #270') - call g:assert.equals(getline(2), 'foo', 'failed at #270') - call g:assert.equals(getline(3), '', 'failed at #270') - call g:assert.equals(getline(4), '', 'failed at #270') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #270') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #270') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #270') + call g:assert.equals(getline(1), 'aa', 'failed at #286') + call g:assert.equals(getline(2), 'foo', 'failed at #286') + call g:assert.equals(getline(3), '', 'failed at #286') + call g:assert.equals(getline(4), '', 'failed at #286') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #286') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #286') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #286') %delete - " #271 + " #287 call append(0, ['(', 'foo', 'aa)']) normal ggV2jsd - call g:assert.equals(getline(1), '', 'failed at #271') - call g:assert.equals(getline(2), 'foo', 'failed at #271') - call g:assert.equals(getline(3), 'aa', 'failed at #271') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #271') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #271') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #271') + call g:assert.equals(getline(1), '', 'failed at #287') + call g:assert.equals(getline(2), 'foo', 'failed at #287') + call g:assert.equals(getline(3), 'aa', 'failed at #287') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #287') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #287') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #287') %delete call operator#sandwich#set('delete', 'line', 'linewise', 2) """ 2 - " #272 + " #288 call append(0, ['(', 'foo', ')']) normal ggV2jsd - call g:assert.equals(getline(1), 'foo', 'failed at #272') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #272') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #272') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #272') + call g:assert.equals(getline(1), 'foo', 'failed at #288') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #288') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #288') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #288') %delete - " #273 + " #289 call append(0, ['( ', 'foo', ' )']) normal ggV2jsd - call g:assert.equals(getline(1), 'foo', 'failed at #273') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #273') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #273') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #273') + call g:assert.equals(getline(1), 'foo', 'failed at #289') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #289') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #289') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #289') %delete - " #274 + " #290 call append(0, ['(aa', 'foo', 'aa)']) normal ggV2jsd - call g:assert.equals(getline(1), 'foo', 'failed at #274') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #274') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #274') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #274') + call g:assert.equals(getline(1), 'foo', 'failed at #290') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #290') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #290') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #290') %delete - " #275 + " #291 call append(0, ['aa', '(foo)', 'bb']) normal ggjVsd - call g:assert.equals(getline(1), 'aa', 'failed at #275') - call g:assert.equals(getline(2), 'bb', 'failed at #275') - call g:assert.equals(getline(3), '', 'failed at #275') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #275') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #275') - call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #275') + call g:assert.equals(getline(1), 'aa', 'failed at #291') + call g:assert.equals(getline(2), 'bb', 'failed at #291') + call g:assert.equals(getline(3), '', 'failed at #291') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #291') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #291') + call g:assert.equals(getpos("']"), [0, 2, 1, 0], 'failed at #291') endfunction "}}} @@ -3028,51 +3116,51 @@ endfunction function! s:suite.blockwise_n_default_recipes() abort "{{{ set whichwrap=h,l - " #276 + " #292 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #276') - call g:assert.equals(getline(2), 'bar', 'failed at #276') - call g:assert.equals(getline(3), 'baz', 'failed at #276') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #276') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #276') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #276') + call g:assert.equals(getline(1), 'foo', 'failed at #292') + call g:assert.equals(getline(2), 'bar', 'failed at #292') + call g:assert.equals(getline(3), 'baz', 'failed at #292') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #292') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #292') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #292') %delete - " #277 + " #293 call append(0, ['[foo]', '[bar]', '[baz]']) execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #277') - call g:assert.equals(getline(2), 'bar', 'failed at #277') - call g:assert.equals(getline(3), 'baz', 'failed at #277') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #277') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #277') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #277') + call g:assert.equals(getline(1), 'foo', 'failed at #293') + call g:assert.equals(getline(2), 'bar', 'failed at #293') + call g:assert.equals(getline(3), 'baz', 'failed at #293') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #293') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #293') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #293') %delete - " #278 + " #294 call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #278') - call g:assert.equals(getline(2), 'bar', 'failed at #278') - call g:assert.equals(getline(3), 'baz', 'failed at #278') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #278') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #278') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #278') + call g:assert.equals(getline(1), 'foo', 'failed at #294') + call g:assert.equals(getline(2), 'bar', 'failed at #294') + call g:assert.equals(getline(3), 'baz', 'failed at #294') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #294') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #294') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #294') %delete - " #279 + " #295 call append(0, ['', '', '']) execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #279') - call g:assert.equals(getline(2), 'bar', 'failed at #279') - call g:assert.equals(getline(3), 'baz', 'failed at #279') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #279') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #279') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #279') + call g:assert.equals(getline(1), 'foo', 'failed at #295') + call g:assert.equals(getline(2), 'bar', 'failed at #295') + call g:assert.equals(getline(3), 'baz', 'failed at #295') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #295') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #295') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #295') set whichwrap& endfunction @@ -3080,25 +3168,25 @@ endfunction function! s:suite.blockwise_n_not_registered() abort "{{{ set whichwrap=h,l - " #280 + " #296 call append(0, ['afooa', 'abara', 'abaza']) execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #280') - call g:assert.equals(getline(2), 'bar', 'failed at #280') - call g:assert.equals(getline(3), 'baz', 'failed at #280') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #280') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #280') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #280') + call g:assert.equals(getline(1), 'foo', 'failed at #296') + call g:assert.equals(getline(2), 'bar', 'failed at #296') + call g:assert.equals(getline(3), 'baz', 'failed at #296') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #296') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #296') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #296') - " #281 + " #297 call append(0, ['*foo*', '*bar*', '*baz*']) execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #281') - call g:assert.equals(getline(2), 'bar', 'failed at #281') - call g:assert.equals(getline(3), 'baz', 'failed at #281') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #281') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #281') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #281') + call g:assert.equals(getline(1), 'foo', 'failed at #297') + call g:assert.equals(getline(2), 'bar', 'failed at #297') + call g:assert.equals(getline(3), 'baz', 'failed at #297') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #297') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #297') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #297') set whichwrap& endfunction @@ -3106,192 +3194,12 @@ endfunction function! s:suite.blockwise_n_positioning() abort "{{{ set whichwrap=h,l - " #282 + " #298 call append(0, ['(foo)bar', '(foo)bar', '(foo)bar']) execute "normal ggsd\23l" - call g:assert.equals(getline(1), 'foobar', 'failed at #282') - call g:assert.equals(getline(2), 'foobar', 'failed at #282') - call g:assert.equals(getline(3), 'foobar', 'failed at #282') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #282') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #282') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #282') - - %delete - - " #283 - call append(0, ['foo(bar)', 'foo(bar)', 'foo(bar)']) - execute "normal gg3lsd\23l" - call g:assert.equals(getline(1), 'foobar', 'failed at #283') - call g:assert.equals(getline(2), 'foobar', 'failed at #283') - call g:assert.equals(getline(3), 'foobar', 'failed at #283') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #283') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #283') - call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #283') - - %delete - - " #284 - call append(0, ['foo(bar)baz', 'foo(bar)baz', 'foo(bar)baz']) - execute "normal gg3lsd\29l" - call g:assert.equals(getline(1), 'foobarbaz', 'failed at #284') - call g:assert.equals(getline(2), 'foobarbaz', 'failed at #284') - call g:assert.equals(getline(3), 'foobarbaz', 'failed at #284') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #284') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #284') - call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #284') - - %delete - - " #285 - call append(0, ['(foo)', '(bar)', 'bazbaz']) - execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #285') - call g:assert.equals(getline(2), 'bar', 'failed at #285') - call g:assert.equals(getline(3), 'bazbaz', 'failed at #285') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #285') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #285') - call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #285') - - %delete - - " #286 - call append(0, ['(foo)', 'barbar', '(baz)']) - execute "normal ggsd\18l" - call g:assert.equals(getline(1), 'foo', 'failed at #286') - call g:assert.equals(getline(2), 'barbar', 'failed at #286') - call g:assert.equals(getline(3), 'baz', 'failed at #286') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #286') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #286') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #286') - - %delete - - " #287 - call append(0, ['foofoo', '(bar)', '(baz)']) - execute "normal ggsd\18l" - call g:assert.equals(getline(1), 'foofoo', 'failed at #287') - call g:assert.equals(getline(2), 'bar', 'failed at #287') - call g:assert.equals(getline(3), 'baz', 'failed at #287') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #287') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #287') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #287') - - %delete - - " #288 - call append(0, ['(foo)', '(baar)', '(baaz)']) - execute "normal ggsd\20l" - call g:assert.equals(getline(1), 'foo', 'failed at #288') - call g:assert.equals(getline(2), 'baar', 'failed at #288') - call g:assert.equals(getline(3), 'baaz', 'failed at #288') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #288') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #288') - call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #288') - - %delete - - " #289 - call append(0, ['(fooo)', '(bar)', '(baaz)']) - execute "normal ggsd\20l" - call g:assert.equals(getline(1), 'fooo', 'failed at #289') - call g:assert.equals(getline(2), 'bar', 'failed at #289') - call g:assert.equals(getline(3), 'baaz', 'failed at #289') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #289') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #289') - call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #289') - - set whichwrap& -endfunction -"}}} -function! s:suite.blockwise_n_a_character() abort "{{{ - " #290 - call setline('.', '(a)') - execute "normal 0sd\a(" - call g:assert.equals(getline('.'), 'a', 'failed at #290') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #290') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #290') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #290') -endfunction -"}}} -function! s:suite.blockwise_n_nothing_inside() abort "{{{ - set whichwrap=h,l - - " #291 - call append(0, ['()', '()', '()']) - execute "normal ggsd\9l" - call g:assert.equals(getline(1), '', 'failed at #291') - call g:assert.equals(getline(2), '', 'failed at #291') - call g:assert.equals(getline(3), '', 'failed at #291') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #291') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #291') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #291') - - %delete - - " #292 - call append(0, ['foo()bar', 'foo()bar', 'foo()bar']) - execute "normal gg3lsd\20l" - call g:assert.equals(getline(1), 'foobar', 'failed at #292') - call g:assert.equals(getline(2), 'foobar', 'failed at #292') - call g:assert.equals(getline(3), 'foobar', 'failed at #292') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #292') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #292') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #292') - - set whichwrap& -endfunction -"}}} -function! s:suite.blockwise_n_count() abort "{{{ - set whichwrap=h,l - - " #293 - call setline('.', '((foo))') - execute "normal 02sd\7l" - call g:assert.equals(getline('.'), 'foo', 'failed at #293') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #293') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #293') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #293') - - " #294 - call setline('.', '{[(foo)]}') - execute "normal 03sd\9l" - call g:assert.equals(getline('.'), 'foo', 'failed at #294') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #294') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #294') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #294') - - " #295 - call setline('.', '(foo)') - execute "normal 0sd\5l" - call g:assert.equals(getline('.'), 'foo', 'failed at #295') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #295') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #295') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #295') - - " #296 - call setline('.', '[(foo bar)]') - execute "normal 02sd\11l" - call g:assert.equals(getline('.'), 'foo bar', 'failed at #296') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #296') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #296') - call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #296') - - " #297 - call setline('.', 'foo{[(bar)]}baz') - execute "normal 03l3sd\9l" - call g:assert.equals(getline('.'), 'foobarbaz', 'failed at #297') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #297') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #297') - call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #297') - - %delete - - " #298 - call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) - execute "normal gg3sd\29l" - call g:assert.equals(getline(1), 'foo', 'failed at #298') - call g:assert.equals(getline(2), 'bar', 'failed at #298') - call g:assert.equals(getline(3), 'baz', 'failed at #298') + call g:assert.equals(getline(1), 'foobar', 'failed at #298') + call g:assert.equals(getline(2), 'foobar', 'failed at #298') + call g:assert.equals(getline(3), 'foobar', 'failed at #298') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #298') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #298') call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #298') @@ -3299,38 +3207,218 @@ function! s:suite.blockwise_n_count() abort "{{{ %delete " #299 - call append(0, ['{[afoob]}', '{[(bar)]}', '{[(baz)]}']) - execute "normal gg3sd\29l" - call g:assert.equals(getline(1), 'afoob', 'failed at #299') - call g:assert.equals(getline(2), 'bar', 'failed at #299') - call g:assert.equals(getline(3), 'baz', 'failed at #299') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #299') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #299') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #299') + call append(0, ['foo(bar)', 'foo(bar)', 'foo(bar)']) + execute "normal gg3lsd\23l" + call g:assert.equals(getline(1), 'foobar', 'failed at #299') + call g:assert.equals(getline(2), 'foobar', 'failed at #299') + call g:assert.equals(getline(3), 'foobar', 'failed at #299') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #299') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #299') + call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #299') %delete " #300 - call append(0, ['{[(foo)]}', '{[abarb]}', '{[(baz)]}']) - execute "normal gg3sd\29l" - call g:assert.equals(getline(1), 'foo', 'failed at #300') - call g:assert.equals(getline(2), 'abarb', 'failed at #300') - call g:assert.equals(getline(3), 'baz', 'failed at #300') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #300') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #300') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #300') + call append(0, ['foo(bar)baz', 'foo(bar)baz', 'foo(bar)baz']) + execute "normal gg3lsd\29l" + call g:assert.equals(getline(1), 'foobarbaz', 'failed at #300') + call g:assert.equals(getline(2), 'foobarbaz', 'failed at #300') + call g:assert.equals(getline(3), 'foobarbaz', 'failed at #300') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #300') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #300') + call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #300') %delete " #301 - call append(0, ['{[(foo)]}', '{[(bar)]}', '{[abazb]}']) - execute "normal gg3sd\29l" + call append(0, ['(foo)', '(bar)', 'bazbaz']) + execute "normal ggsd\17l" call g:assert.equals(getline(1), 'foo', 'failed at #301') call g:assert.equals(getline(2), 'bar', 'failed at #301') - call g:assert.equals(getline(3), 'abazb', 'failed at #301') + call g:assert.equals(getline(3), 'bazbaz', 'failed at #301') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #301') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #301') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #301') + call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #301') + + %delete + + " #302 + call append(0, ['(foo)', 'barbar', '(baz)']) + execute "normal ggsd\18l" + call g:assert.equals(getline(1), 'foo', 'failed at #302') + call g:assert.equals(getline(2), 'barbar', 'failed at #302') + call g:assert.equals(getline(3), 'baz', 'failed at #302') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #302') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #302') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #302') + + %delete + + " #303 + call append(0, ['foofoo', '(bar)', '(baz)']) + execute "normal ggsd\18l" + call g:assert.equals(getline(1), 'foofoo', 'failed at #303') + call g:assert.equals(getline(2), 'bar', 'failed at #303') + call g:assert.equals(getline(3), 'baz', 'failed at #303') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #303') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #303') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #303') + + %delete + + " #304 + call append(0, ['(foo)', '(baar)', '(baaz)']) + execute "normal ggsd\20l" + call g:assert.equals(getline(1), 'foo', 'failed at #304') + call g:assert.equals(getline(2), 'baar', 'failed at #304') + call g:assert.equals(getline(3), 'baaz', 'failed at #304') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #304') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #304') + call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #304') + + %delete + + " #305 + call append(0, ['(fooo)', '(bar)', '(baaz)']) + execute "normal ggsd\20l" + call g:assert.equals(getline(1), 'fooo', 'failed at #305') + call g:assert.equals(getline(2), 'bar', 'failed at #305') + call g:assert.equals(getline(3), 'baaz', 'failed at #305') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #305') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #305') + call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #305') + + set whichwrap& +endfunction +"}}} +function! s:suite.blockwise_n_a_character() abort "{{{ + " #306 + call setline('.', '(a)') + execute "normal 0sd\a(" + call g:assert.equals(getline('.'), 'a', 'failed at #306') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #306') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #306') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #306') +endfunction +"}}} +function! s:suite.blockwise_n_nothing_inside() abort "{{{ + set whichwrap=h,l + + " #307 + call append(0, ['()', '()', '()']) + execute "normal ggsd\9l" + call g:assert.equals(getline(1), '', 'failed at #307') + call g:assert.equals(getline(2), '', 'failed at #307') + call g:assert.equals(getline(3), '', 'failed at #307') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #307') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #307') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #307') + + %delete + + " #308 + call append(0, ['foo()bar', 'foo()bar', 'foo()bar']) + execute "normal gg3lsd\20l" + call g:assert.equals(getline(1), 'foobar', 'failed at #308') + call g:assert.equals(getline(2), 'foobar', 'failed at #308') + call g:assert.equals(getline(3), 'foobar', 'failed at #308') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #308') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #308') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #308') + + set whichwrap& +endfunction +"}}} +function! s:suite.blockwise_n_count() abort "{{{ + set whichwrap=h,l + + " #309 + call setline('.', '((foo))') + execute "normal 02sd\7l" + call g:assert.equals(getline('.'), 'foo', 'failed at #309') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #309') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #309') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #309') + + " #310 + call setline('.', '{[(foo)]}') + execute "normal 03sd\9l" + call g:assert.equals(getline('.'), 'foo', 'failed at #310') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #310') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #310') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #310') + + " #311 + call setline('.', '(foo)') + execute "normal 0sd\5l" + call g:assert.equals(getline('.'), 'foo', 'failed at #311') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #311') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #311') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #311') + + " #312 + call setline('.', '[(foo bar)]') + execute "normal 02sd\11l" + call g:assert.equals(getline('.'), 'foo bar', 'failed at #312') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #312') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #312') + call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #312') + + " #313 + call setline('.', 'foo{[(bar)]}baz') + execute "normal 03l3sd\9l" + call g:assert.equals(getline('.'), 'foobarbaz', 'failed at #313') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #313') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #313') + call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #313') + + %delete + + " #314 + call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) + execute "normal gg3sd\29l" + call g:assert.equals(getline(1), 'foo', 'failed at #314') + call g:assert.equals(getline(2), 'bar', 'failed at #314') + call g:assert.equals(getline(3), 'baz', 'failed at #314') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #314') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #314') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #314') + + %delete + + " #315 + call append(0, ['{[afoob]}', '{[(bar)]}', '{[(baz)]}']) + execute "normal gg3sd\29l" + call g:assert.equals(getline(1), 'afoob', 'failed at #315') + call g:assert.equals(getline(2), 'bar', 'failed at #315') + call g:assert.equals(getline(3), 'baz', 'failed at #315') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #315') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #315') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #315') + + %delete + + " #316 + call append(0, ['{[(foo)]}', '{[abarb]}', '{[(baz)]}']) + execute "normal gg3sd\29l" + call g:assert.equals(getline(1), 'foo', 'failed at #316') + call g:assert.equals(getline(2), 'abarb', 'failed at #316') + call g:assert.equals(getline(3), 'baz', 'failed at #316') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #316') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #316') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #316') + + %delete + + " #317 + call append(0, ['{[(foo)]}', '{[(bar)]}', '{[abazb]}']) + execute "normal gg3sd\29l" + call g:assert.equals(getline(1), 'foo', 'failed at #317') + call g:assert.equals(getline(2), 'bar', 'failed at #317') + call g:assert.equals(getline(3), 'abazb', 'failed at #317') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #317') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #317') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #317') set whichwrap& endfunction @@ -3345,40 +3433,40 @@ function! s:suite.blockwise_n_external_textobj() abort"{{{ \ {'external': ['it', 'at']}, \ ] - " #302 + " #318 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal gg2lsd\25l" - call g:assert.equals(getline(1), '{[foo]}', 'failed at #302') - call g:assert.equals(getline(2), '{[bar]}', 'failed at #302') - call g:assert.equals(getline(3), '{[baz]}', 'failed at #302') + call g:assert.equals(getline(1), '{[foo]}', 'failed at #318') + call g:assert.equals(getline(2), '{[bar]}', 'failed at #318') + call g:assert.equals(getline(3), '{[baz]}', 'failed at #318') %delete - " #303 + " #319 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal gglsd\27l" - call g:assert.equals(getline(1), '{(foo)}', 'failed at #303') - call g:assert.equals(getline(2), '{(bar)}', 'failed at #303') - call g:assert.equals(getline(3), '{(baz)}', 'failed at #303') + call g:assert.equals(getline(1), '{(foo)}', 'failed at #319') + call g:assert.equals(getline(2), '{(bar)}', 'failed at #319') + call g:assert.equals(getline(3), '{(baz)}', 'failed at #319') %delete - " #304 + " #320 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggsd\29l" - call g:assert.equals(getline(1), '[(foo)]', 'failed at #304') - call g:assert.equals(getline(2), '[(bar)]', 'failed at #304') - call g:assert.equals(getline(3), '[(baz)]', 'failed at #304') + call g:assert.equals(getline(1), '[(foo)]', 'failed at #320') + call g:assert.equals(getline(2), '[(bar)]', 'failed at #320') + call g:assert.equals(getline(3), '[(baz)]', 'failed at #320') %delete - " #305 + " #321 call setline('.', 'foo') call append(0, ['foo', 'bar', 'baz']) execute "normal ggsd\56l" - call g:assert.equals(getline(1), 'foo', 'failed at #305') - call g:assert.equals(getline(2), 'bar', 'failed at #305') - call g:assert.equals(getline(3), 'baz', 'failed at #305') + call g:assert.equals(getline(1), 'foo', 'failed at #321') + call g:assert.equals(getline(2), 'bar', 'failed at #321') + call g:assert.equals(getline(3), 'baz', 'failed at #321') set whichwrap& unlet g:sandwich#recipes @@ -3390,96 +3478,96 @@ function! s:suite.blockwise_n_option_cursor() abort "{{{ """"" cursor """ inner_head - " #306 + " #322 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl2sd\27l" - call g:assert.equals(getline(1), '{foo}', 'failed at #306') - call g:assert.equals(getline(2), '{bar}', 'failed at #306') - call g:assert.equals(getline(3), '{baz}', 'failed at #306') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #306') + call g:assert.equals(getline(1), '{foo}', 'failed at #322') + call g:assert.equals(getline(2), '{bar}', 'failed at #322') + call g:assert.equals(getline(3), '{baz}', 'failed at #322') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #322') - " #307 + " #323 execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #307') - call g:assert.equals(getline(2), 'bar', 'failed at #307') - call g:assert.equals(getline(3), 'baz', 'failed at #307') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #307') + call g:assert.equals(getline(1), 'foo', 'failed at #323') + call g:assert.equals(getline(2), 'bar', 'failed at #323') + call g:assert.equals(getline(3), 'baz', 'failed at #323') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #323') %delete """ keep - " #308 + " #324 call operator#sandwich#set('delete', 'block', 'cursor', 'keep') call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl2sd\27l" - call g:assert.equals(getline(1), '{foo}', 'failed at #308') - call g:assert.equals(getline(2), '{bar}', 'failed at #308') - call g:assert.equals(getline(3), '{baz}', 'failed at #308') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #308') + call g:assert.equals(getline(1), '{foo}', 'failed at #324') + call g:assert.equals(getline(2), '{bar}', 'failed at #324') + call g:assert.equals(getline(3), '{baz}', 'failed at #324') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #324') - " #309 + " #325 execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #309') - call g:assert.equals(getline(2), 'bar', 'failed at #309') - call g:assert.equals(getline(3), 'baz', 'failed at #309') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #309') + call g:assert.equals(getline(1), 'foo', 'failed at #325') + call g:assert.equals(getline(2), 'bar', 'failed at #325') + call g:assert.equals(getline(3), 'baz', 'failed at #325') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #325') %delete """ inner_tail - " #310 + " #326 call operator#sandwich#set('delete', 'block', 'cursor', 'inner_tail') call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl2sd\27l" - call g:assert.equals(getline(1), '{foo}', 'failed at #310') - call g:assert.equals(getline(2), '{bar}', 'failed at #310') - call g:assert.equals(getline(3), '{baz}', 'failed at #310') - call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #310') + call g:assert.equals(getline(1), '{foo}', 'failed at #326') + call g:assert.equals(getline(2), '{bar}', 'failed at #326') + call g:assert.equals(getline(3), '{baz}', 'failed at #326') + call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #326') - " #311 + " #327 execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #311') - call g:assert.equals(getline(2), 'bar', 'failed at #311') - call g:assert.equals(getline(3), 'baz', 'failed at #311') - call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #311') + call g:assert.equals(getline(1), 'foo', 'failed at #327') + call g:assert.equals(getline(2), 'bar', 'failed at #327') + call g:assert.equals(getline(3), 'baz', 'failed at #327') + call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #327') %delete """ head - " #312 + " #328 call operator#sandwich#set('delete', 'block', 'cursor', 'head') call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl2sd\27l" - call g:assert.equals(getline(1), '{foo}', 'failed at #312') - call g:assert.equals(getline(2), '{bar}', 'failed at #312') - call g:assert.equals(getline(3), '{baz}', 'failed at #312') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #312') + call g:assert.equals(getline(1), '{foo}', 'failed at #328') + call g:assert.equals(getline(2), '{bar}', 'failed at #328') + call g:assert.equals(getline(3), '{baz}', 'failed at #328') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #328') - " #313 + " #329 execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #313') - call g:assert.equals(getline(2), 'bar', 'failed at #313') - call g:assert.equals(getline(3), 'baz', 'failed at #313') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #313') + call g:assert.equals(getline(1), 'foo', 'failed at #329') + call g:assert.equals(getline(2), 'bar', 'failed at #329') + call g:assert.equals(getline(3), 'baz', 'failed at #329') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #329') %delete """ tail - " #314 + " #330 call operator#sandwich#set('delete', 'block', 'cursor', 'tail') call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl2sd\27l" - call g:assert.equals(getline(1), '{foo}', 'failed at #314') - call g:assert.equals(getline(2), '{bar}', 'failed at #314') - call g:assert.equals(getline(3), '{baz}', 'failed at #314') - call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #314') + call g:assert.equals(getline(1), '{foo}', 'failed at #330') + call g:assert.equals(getline(2), '{bar}', 'failed at #330') + call g:assert.equals(getline(3), '{baz}', 'failed at #330') + call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #330') - " #315 + " #331 execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #315') - call g:assert.equals(getline(2), 'bar', 'failed at #315') - call g:assert.equals(getline(3), 'baz', 'failed at #315') - call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #315') + call g:assert.equals(getline(1), 'foo', 'failed at #331') + call g:assert.equals(getline(2), 'bar', 'failed at #331') + call g:assert.equals(getline(3), 'baz', 'failed at #331') + call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #331') set whichwrap& call operator#sandwich#set('delete', 'block', 'cursor', 'inner_head') @@ -3495,41 +3583,41 @@ function! s:suite.blockwise_n_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #316 + " #332 call append(0, ['{(foo)}', '{(bar)}', '{(baz)}']) execute "normal ggsd\23l" - call g:assert.equals(getline(1), '(foo)', 'failed at #316') - call g:assert.equals(getline(2), '(bar)', 'failed at #316') - call g:assert.equals(getline(3), '(baz)', 'failed at #316') + call g:assert.equals(getline(1), '(foo)', 'failed at #332') + call g:assert.equals(getline(2), '(bar)', 'failed at #332') + call g:assert.equals(getline(3), '(baz)', 'failed at #332') %delete - " #317 + " #333 call append(0, ['{(foo)}', '{(bar)}', '{(baz)}']) execute "normal gglsd\21l" - call g:assert.equals(getline(1), '{(foo)}', 'failed at #317') - call g:assert.equals(getline(2), '{(bar)}', 'failed at #317') - call g:assert.equals(getline(3), '{(baz)}', 'failed at #317') + call g:assert.equals(getline(1), '{(foo)}', 'failed at #333') + call g:assert.equals(getline(2), '{(bar)}', 'failed at #333') + call g:assert.equals(getline(3), '{(baz)}', 'failed at #333') %delete """ off - " #318 + " #334 call operator#sandwich#set('delete', 'block', 'noremap', 0) call append(0, ['{(foo)}', '{(bar)}', '{(baz)}']) execute "normal ggsd\23l" - call g:assert.equals(getline(1), '{(foo)}', 'failed at #318') - call g:assert.equals(getline(2), '{(bar)}', 'failed at #318') - call g:assert.equals(getline(3), '{(baz)}', 'failed at #318') + call g:assert.equals(getline(1), '{(foo)}', 'failed at #334') + call g:assert.equals(getline(2), '{(bar)}', 'failed at #334') + call g:assert.equals(getline(3), '{(baz)}', 'failed at #334') %delete - " #319 + " #335 call append(0, ['{(foo)}', '{(bar)}', '{(baz)}']) execute "normal gglsd\21l" - call g:assert.equals(getline(1), '{foo}', 'failed at #319') - call g:assert.equals(getline(2), '{bar}', 'failed at #319') - call g:assert.equals(getline(3), '{baz}', 'failed at #319') + call g:assert.equals(getline(1), '{foo}', 'failed at #335') + call g:assert.equals(getline(2), '{bar}', 'failed at #335') + call g:assert.equals(getline(3), '{baz}', 'failed at #335') set whichwrap& unlet! g:sandwich#recipes @@ -3545,41 +3633,41 @@ function! s:suite.blockwise_n_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #320 + " #336 call append(0, ['\d\+foo\d\+', '\d\+bar\d\+', '\d\+baz\d\+']) execute "normal ggsd\36l" - call g:assert.equals(getline(1), 'foo', 'failed at #320') - call g:assert.equals(getline(2), 'bar', 'failed at #320') - call g:assert.equals(getline(3), 'baz', 'failed at #320') + call g:assert.equals(getline(1), 'foo', 'failed at #336') + call g:assert.equals(getline(2), 'bar', 'failed at #336') + call g:assert.equals(getline(3), 'baz', 'failed at #336') %delete - " #321 + " #337 call append(0, ['888foo888', '888bar888', '888baz888']) execute "normal ggsd\29l" - call g:assert.equals(getline(1), '88foo88', 'failed at #321') - call g:assert.equals(getline(2), '88bar88', 'failed at #321') - call g:assert.equals(getline(3), '88baz88', 'failed at #321') + call g:assert.equals(getline(1), '88foo88', 'failed at #337') + call g:assert.equals(getline(2), '88bar88', 'failed at #337') + call g:assert.equals(getline(3), '88baz88', 'failed at #337') %delete """ on call operator#sandwich#set('delete', 'block', 'regex', 1) - " #322 + " #338 call append(0, ['\d\+foo\d\+', '\d\+bar\d\+', '\d\+baz\d\+']) execute "normal ggsd\36l" - call g:assert.equals(getline(1), '\d\+foo\d\+', 'failed at #322') - call g:assert.equals(getline(2), '\d\+bar\d\+', 'failed at #322') - call g:assert.equals(getline(3), '\d\+baz\d\+', 'failed at #322') + call g:assert.equals(getline(1), '\d\+foo\d\+', 'failed at #338') + call g:assert.equals(getline(2), '\d\+bar\d\+', 'failed at #338') + call g:assert.equals(getline(3), '\d\+baz\d\+', 'failed at #338') %delete - " #323 + " #339 call append(0, ['888foo888', '888bar888', '888baz888']) execute "normal ggsd\29l" - call g:assert.equals(getline(1), 'foo', 'failed at #323') - call g:assert.equals(getline(2), 'bar', 'failed at #323') - call g:assert.equals(getline(3), 'baz', 'failed at #323') + call g:assert.equals(getline(1), 'foo', 'failed at #339') + call g:assert.equals(getline(2), 'bar', 'failed at #339') + call g:assert.equals(getline(3), 'baz', 'failed at #339') set whichwrap& call operator#sandwich#set('delete', 'block', 'regex', 0) @@ -3590,78 +3678,118 @@ endfunction function! s:suite.blockwise_n_option_skip_space() abort "{{{ set whichwrap=h,l - """ on - " #324 + """ 1 + " #340 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #324') - call g:assert.equals(getline(2), 'bar', 'failed at #324') - call g:assert.equals(getline(3), 'baz', 'failed at #324') + call g:assert.equals(getline(1), 'foo', 'failed at #340') + call g:assert.equals(getline(2), 'bar', 'failed at #340') + call g:assert.equals(getline(3), 'baz', 'failed at #340') %delete - " #325 + " #341 call append(0, [' "foo"', ' "bar"', ' "baz"']) execute "normal ggsd\20l" - call g:assert.equals(getline(1), ' foo', 'failed at #325') - call g:assert.equals(getline(2), ' bar', 'failed at #325') - call g:assert.equals(getline(3), ' baz', 'failed at #325') + call g:assert.equals(getline(1), ' foo', 'failed at #341') + call g:assert.equals(getline(2), ' bar', 'failed at #341') + call g:assert.equals(getline(3), ' baz', 'failed at #341') %delete - " #326 + " #342 call append(0, ['"foo" ', '"bar" ', '"baz" ']) execute "normal ggsd\20l" - call g:assert.equals(getline(1), 'foo ', 'failed at #326') - call g:assert.equals(getline(2), 'bar ', 'failed at #326') - call g:assert.equals(getline(3), 'baz ', 'failed at #326') + call g:assert.equals(getline(1), 'foo ', 'failed at #342') + call g:assert.equals(getline(2), 'bar ', 'failed at #342') + call g:assert.equals(getline(3), 'baz ', 'failed at #342') %delete - " #327 + " #343 " do not skip! call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) execute "normal ggsd\23l" - call g:assert.equals(getline('.'), '"foo"', 'failed at #327') + call g:assert.equals(getline(1), '"foo"', 'failed at #343') + call g:assert.equals(getline(2), '"bar"', 'failed at #343') + call g:assert.equals(getline(3), '"baz"', 'failed at #343') %delete - """ off + """ 2 + call operator#sandwich#set('delete', 'block', 'skip_space', 2) + " #344 + call append(0, ['"foo"', '"bar"', '"baz"']) + execute "normal ggsd\17l" + call g:assert.equals(getline(1), 'foo', 'failed at #344') + call g:assert.equals(getline(2), 'bar', 'failed at #344') + call g:assert.equals(getline(3), 'baz', 'failed at #344') + + %delete + + " #345 + call append(0, [' "foo"', ' "bar"', ' "baz"']) + execute "normal ggsd\20l" + call g:assert.equals(getline(1), ' foo', 'failed at #345') + call g:assert.equals(getline(2), ' bar', 'failed at #345') + call g:assert.equals(getline(3), ' baz', 'failed at #345') + + %delete + + " #346 + call append(0, ['"foo" ', '"bar" ', '"baz" ']) + execute "normal ggsd\20l" + call g:assert.equals(getline(1), 'foo ', 'failed at #346') + call g:assert.equals(getline(2), 'bar ', 'failed at #346') + call g:assert.equals(getline(3), 'baz ', 'failed at #346') + + %delete + + " #347 + call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) + execute "normal ggsd\23l" + call g:assert.equals(getline(1), ' foo ', 'failed at #347') + call g:assert.equals(getline(2), ' bar ', 'failed at #347') + call g:assert.equals(getline(3), ' baz ', 'failed at #347') + + %delete + + """ 0 call operator#sandwich#set('delete', 'block', 'skip_space', 0) - " #328 + " #348 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal ggsd\17l" - call g:assert.equals(getline(1), 'foo', 'failed at #328') - call g:assert.equals(getline(2), 'bar', 'failed at #328') - call g:assert.equals(getline(3), 'baz', 'failed at #328') + call g:assert.equals(getline(1), 'foo', 'failed at #348') + call g:assert.equals(getline(2), 'bar', 'failed at #348') + call g:assert.equals(getline(3), 'baz', 'failed at #348') %delete - " #329 + " #349 call append(0, [' "foo"', ' "bar"', ' "baz"']) execute "normal ggsd\20l" - call g:assert.equals(getline(1), ' "foo"', 'failed at #329') - call g:assert.equals(getline(2), ' "bar"', 'failed at #329') - call g:assert.equals(getline(3), ' "baz"', 'failed at #329') + call g:assert.equals(getline(1), ' "foo"', 'failed at #349') + call g:assert.equals(getline(2), ' "bar"', 'failed at #349') + call g:assert.equals(getline(3), ' "baz"', 'failed at #349') %delete - " #330 + " #350 call append(0, ['"foo" ', '"bar" ', '"baz" ']) execute "normal ggsd\20l" - call g:assert.equals(getline(1), '"foo" ', 'failed at #330') - call g:assert.equals(getline(2), '"bar" ', 'failed at #330') - call g:assert.equals(getline(3), '"baz" ', 'failed at #330') + call g:assert.equals(getline(1), '"foo" ', 'failed at #350') + call g:assert.equals(getline(2), '"bar" ', 'failed at #350') + call g:assert.equals(getline(3), '"baz" ', 'failed at #350') %delete - " #331 + " #351 " do not skip! call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) execute "normal ggsd\23l" - call g:assert.equals(getline(1), '"foo"', 'failed at #331') - call g:assert.equals(getline(2), '"bar"', 'failed at #331') - call g:assert.equals(getline(3), '"baz"', 'failed at #331') + call g:assert.equals(getline(1), '"foo"', 'failed at #351') + call g:assert.equals(getline(2), '"bar"', 'failed at #351') + call g:assert.equals(getline(3), '"baz"', 'failed at #351') set whichwrap& call operator#sandwich#set('delete', 'block', 'skip_space', 1) @@ -3671,23 +3799,23 @@ function! s:suite.blockwise_n_option_skip_char() abort "{{{ set whichwrap=h,l """ off - " #332 + " #352 call append(0, ['aa(foo)bb', 'aa(bar)bb', 'aa(baz)bb']) execute "normal ggsd\29l" - call g:assert.equals(getline(1), 'aa(foo)bb', 'failed at #332') - call g:assert.equals(getline(2), 'aa(bar)bb', 'failed at #332') - call g:assert.equals(getline(3), 'aa(baz)bb', 'failed at #332') + call g:assert.equals(getline(1), 'aa(foo)bb', 'failed at #352') + call g:assert.equals(getline(2), 'aa(bar)bb', 'failed at #352') + call g:assert.equals(getline(3), 'aa(baz)bb', 'failed at #352') %delete """ on call operator#sandwich#set('delete', 'block', 'skip_char', 1) - " #333 + " #353 call append(0, ['aa(foo)bb', 'aa(bar)bb', 'aa(baz)bb']) execute "normal ggsd\29l" - call g:assert.equals(getline(1), 'aafoobb', 'failed at #333') - call g:assert.equals(getline(2), 'aabarbb', 'failed at #333') - call g:assert.equals(getline(3), 'aabazbb', 'failed at #333') + call g:assert.equals(getline(1), 'aafoobb', 'failed at #353') + call g:assert.equals(getline(2), 'aabarbb', 'failed at #353') + call g:assert.equals(getline(3), 'aabazbb', 'failed at #353') set whichwrap& call operator#sandwich#set('delete', 'block', 'skip_char', 0) @@ -3697,12 +3825,12 @@ function! s:suite.blockwise_n_option_command() abort "{{{ set whichwrap=h,l call operator#sandwich#set('delete', 'block', 'command', ['normal! `[dv`]']) - " #334 + " #354 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal ggsd\17l" - call g:assert.equals(getline(1), '', 'failed at #334') - call g:assert.equals(getline(2), '', 'failed at #334') - call g:assert.equals(getline(3), '', 'failed at #334') + call g:assert.equals(getline(1), '', 'failed at #354') + call g:assert.equals(getline(2), '', 'failed at #354') + call g:assert.equals(getline(3), '', 'failed at #354') set whichwrap& call operator#sandwich#set('delete', 'block', 'command', []) @@ -3710,286 +3838,57 @@ endfunction "}}} function! s:suite.blockwise_x_default_recipes() abort "{{{ - " #335 + " #355 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #335') - call g:assert.equals(getline(2), 'bar', 'failed at #335') - call g:assert.equals(getline(3), 'baz', 'failed at #335') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #335') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #335') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #335') + call g:assert.equals(getline(1), 'foo', 'failed at #355') + call g:assert.equals(getline(2), 'bar', 'failed at #355') + call g:assert.equals(getline(3), 'baz', 'failed at #355') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #355') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #355') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #355') %delete - " #336 + " #356 call append(0, ['[foo]', '[bar]', '[baz]']) execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #336') - call g:assert.equals(getline(2), 'bar', 'failed at #336') - call g:assert.equals(getline(3), 'baz', 'failed at #336') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #336') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #336') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #336') + call g:assert.equals(getline(1), 'foo', 'failed at #356') + call g:assert.equals(getline(2), 'bar', 'failed at #356') + call g:assert.equals(getline(3), 'baz', 'failed at #356') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #356') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #356') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #356') %delete - " #337 + " #357 call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #337') - call g:assert.equals(getline(2), 'bar', 'failed at #337') - call g:assert.equals(getline(3), 'baz', 'failed at #337') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #337') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #337') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #337') + call g:assert.equals(getline(1), 'foo', 'failed at #357') + call g:assert.equals(getline(2), 'bar', 'failed at #357') + call g:assert.equals(getline(3), 'baz', 'failed at #357') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #357') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #357') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #357') %delete - " #338 + " #358 call append(0, ['', '', '']) execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #338') - call g:assert.equals(getline(2), 'bar', 'failed at #338') - call g:assert.equals(getline(3), 'baz', 'failed at #338') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #338') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #338') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #338') + call g:assert.equals(getline(1), 'foo', 'failed at #358') + call g:assert.equals(getline(2), 'bar', 'failed at #358') + call g:assert.equals(getline(3), 'baz', 'failed at #358') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #358') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #358') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #358') endfunction "}}} function! s:suite.blockwise_x_not_registered() abort "{{{ - " #339 + " #359 call append(0, ['afooa', 'abara', 'abaza']) execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #339') - call g:assert.equals(getline(2), 'bar', 'failed at #339') - call g:assert.equals(getline(3), 'baz', 'failed at #339') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #339') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #339') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #339') - - " #340 - call append(0, ['*foo*', '*bar*', '*baz*']) - execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #340') - call g:assert.equals(getline(2), 'bar', 'failed at #340') - call g:assert.equals(getline(3), 'baz', 'failed at #340') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #340') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #340') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #340') -endfunction -"}}} -function! s:suite.blockwise_x_positioning() abort "{{{ - " #341 - call append(0, ['(foo)bar', '(foo)bar', '(foo)bar']) - execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foobar', 'failed at #341') - call g:assert.equals(getline(2), 'foobar', 'failed at #341') - call g:assert.equals(getline(3), 'foobar', 'failed at #341') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #341') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #341') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #341') - - %delete - - " #342 - call append(0, ['foo(bar)', 'foo(bar)', 'foo(bar)']) - execute "normal gg3l\2j4lsd" - call g:assert.equals(getline(1), 'foobar', 'failed at #342') - call g:assert.equals(getline(2), 'foobar', 'failed at #342') - call g:assert.equals(getline(3), 'foobar', 'failed at #342') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #342') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #342') - call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #342') - - %delete - - " #343 - call append(0, ['foo(bar)baz', 'foo(bar)baz', 'foo(bar)baz']) - execute "normal gg3l\2j4lsd" - call g:assert.equals(getline(1), 'foobarbaz', 'failed at #343') - call g:assert.equals(getline(2), 'foobarbaz', 'failed at #343') - call g:assert.equals(getline(3), 'foobarbaz', 'failed at #343') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #343') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #343') - call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #343') - - %delete - - " #344 - call append(0, ['(foo)', '(bar)', 'bazbaz']) - execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #344') - call g:assert.equals(getline(2), 'bar', 'failed at #344') - call g:assert.equals(getline(3), 'bazbaz', 'failed at #344') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #344') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #344') - call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #344') - - %delete - - " #345 - call append(0, ['(foo)', 'barbar', '(baz)']) - execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #345') - call g:assert.equals(getline(2), 'barbar', 'failed at #345') - call g:assert.equals(getline(3), 'baz', 'failed at #345') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #345') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #345') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #345') - - %delete - - " #346 - call append(0, ['foofoo', '(bar)', '(baz)']) - execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foofoo', 'failed at #346') - call g:assert.equals(getline(2), 'bar', 'failed at #346') - call g:assert.equals(getline(3), 'baz', 'failed at #346') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #346') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #346') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #346') - - %delete - - " #347 - call append(0, ['(foo)', '(baar)', '(baaz)']) - execute "normal gg\2j5lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #347') - call g:assert.equals(getline(2), 'baar', 'failed at #347') - call g:assert.equals(getline(3), 'baaz', 'failed at #347') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #347') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #347') - call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #347') - - %delete - - " #348 - call append(0, ['(fooo)', '(bar)', '(baaz)']) - execute "normal gg\2j5lsd" - call g:assert.equals(getline(1), 'fooo', 'failed at #348') - call g:assert.equals(getline(2), 'bar', 'failed at #348') - call g:assert.equals(getline(3), 'baaz', 'failed at #348') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #348') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #348') - call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #348') - - %delete - - " #349 - call append(0, ['(fooo)', '(baar)', '(baz)']) - set virtualedit=block - execute "normal gg\2j5lsd" - call g:assert.equals(getline(1), 'fooo', 'failed at #349') - call g:assert.equals(getline(2), 'baar', 'failed at #349') - call g:assert.equals(getline(3), 'baz', 'failed at #349') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #349') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #349') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #349') - set virtualedit& - - %delete - - """ terminal-extended block-wise visual mode - " #350 - call append(0, ['(fooo)', '(baaar)', '(baz)']) - execute "normal gg\2j$sd" - call g:assert.equals(getline(1), 'fooo', 'failed at #350') - call g:assert.equals(getline(2), 'baaar', 'failed at #350') - call g:assert.equals(getline(3), 'baz', 'failed at #350') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #350') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #350') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #350') - - %delete - - " #351 - call append(0, ['(foooo)', '(bar)', '(baaz)']) - execute "normal gg\2j$sd" - call g:assert.equals(getline(1), 'foooo', 'failed at #351') - call g:assert.equals(getline(2), 'bar', 'failed at #351') - call g:assert.equals(getline(3), 'baaz', 'failed at #351') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #351') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #351') - call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #351') - - %delete - - " #352 - call append(0, ['(fooo)', '', '(baz)']) - execute "normal gg\2j$sd" - call g:assert.equals(getline(1), 'fooo', 'failed at #352') - call g:assert.equals(getline(2), '', 'failed at #352') - call g:assert.equals(getline(3), 'baz', 'failed at #352') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #352') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #352') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #352') -endfunction -"}}} -function! s:suite.blockwise_x_a_character() abort "{{{ - " #353 - call setline('.', '(a)') - execute "normal 0\2lsd" - call g:assert.equals(getline('.'), 'a', 'failed at #353') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #353') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #353') - call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #353') -endfunction -"}}} -function! s:suite.blockwise_x_nothing_inside() abort "{{{ - " #354 - call append(0, ['()', '()', '()']) - execute "normal gg\2jlsd" - call g:assert.equals(getline(1), '', 'failed at #354') - call g:assert.equals(getline(2), '', 'failed at #354') - call g:assert.equals(getline(3), '', 'failed at #354') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #354') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #354') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #354') - - %delete - - " #355 - call append(0, ['foo()bar', 'foo()bar', 'foo()bar']) - execute "normal gg3l\2jlsd" - call g:assert.equals(getline(1), 'foobar', 'failed at #355') - call g:assert.equals(getline(2), 'foobar', 'failed at #355') - call g:assert.equals(getline(3), 'foobar', 'failed at #355') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #355') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #355') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #355') -endfunction -"}}} -function! s:suite.blockwise_x_count() abort "{{{ - " #356 - call setline('.', '((foo))') - execute "normal 0\6l2sd" - call g:assert.equals(getline('.'), 'foo', 'failed at #356') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #356') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #356') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #356') - - " #357 - call setline('.', '{[(foo)]}') - execute "normal 0\8l3sd" - call g:assert.equals(getline('.'), 'foo', 'failed at #357') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #357') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #357') - call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #357') - - " #358 - call setline('.', 'foo{[(bar)]}baz') - execute "normal 03l\8l3sd" - call g:assert.equals(getline('.'), 'foobarbaz', 'failed at #358') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #358') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #358') - call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #358') - - %delete - - " #359 - call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) - execute "normal gg\2j8l3sd" call g:assert.equals(getline(1), 'foo', 'failed at #359') call g:assert.equals(getline(2), 'bar', 'failed at #359') call g:assert.equals(getline(3), 'baz', 'failed at #359') @@ -3997,26 +3896,24 @@ function! s:suite.blockwise_x_count() abort "{{{ call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #359') call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #359') - %delete - " #360 - call append(0, ['{[afoob]}', '{[(bar)]}', '{[(baz)]}']) - execute "normal gg\2j8l3sd" - call g:assert.equals(getline(1), 'afoob', 'failed at #360') + call append(0, ['*foo*', '*bar*', '*baz*']) + execute "normal gg\2j4lsd" + call g:assert.equals(getline(1), 'foo', 'failed at #360') call g:assert.equals(getline(2), 'bar', 'failed at #360') call g:assert.equals(getline(3), 'baz', 'failed at #360') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #360') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #360') call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #360') - - %delete - +endfunction +"}}} +function! s:suite.blockwise_x_positioning() abort "{{{ " #361 - call append(0, ['{[(foo)]}', '{[abarb]}', '{[(baz)]}']) - execute "normal gg\2j8l3sd" - call g:assert.equals(getline(1), 'foo', 'failed at #361') - call g:assert.equals(getline(2), 'abarb', 'failed at #361') - call g:assert.equals(getline(3), 'baz', 'failed at #361') + call append(0, ['(foo)bar', '(foo)bar', '(foo)bar']) + execute "normal gg\2j4lsd" + call g:assert.equals(getline(1), 'foobar', 'failed at #361') + call g:assert.equals(getline(2), 'foobar', 'failed at #361') + call g:assert.equals(getline(3), 'foobar', 'failed at #361') call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #361') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #361') call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #361') @@ -4024,14 +3921,245 @@ function! s:suite.blockwise_x_count() abort "{{{ %delete " #362 + call append(0, ['foo(bar)', 'foo(bar)', 'foo(bar)']) + execute "normal gg3l\2j4lsd" + call g:assert.equals(getline(1), 'foobar', 'failed at #362') + call g:assert.equals(getline(2), 'foobar', 'failed at #362') + call g:assert.equals(getline(3), 'foobar', 'failed at #362') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #362') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #362') + call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #362') + + %delete + + " #363 + call append(0, ['foo(bar)baz', 'foo(bar)baz', 'foo(bar)baz']) + execute "normal gg3l\2j4lsd" + call g:assert.equals(getline(1), 'foobarbaz', 'failed at #363') + call g:assert.equals(getline(2), 'foobarbaz', 'failed at #363') + call g:assert.equals(getline(3), 'foobarbaz', 'failed at #363') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #363') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #363') + call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #363') + + %delete + + " #364 + call append(0, ['(foo)', '(bar)', 'bazbaz']) + execute "normal gg\2j4lsd" + call g:assert.equals(getline(1), 'foo', 'failed at #364') + call g:assert.equals(getline(2), 'bar', 'failed at #364') + call g:assert.equals(getline(3), 'bazbaz', 'failed at #364') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #364') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #364') + call g:assert.equals(getpos("']"), [0, 2, 4, 0], 'failed at #364') + + %delete + + " #365 + call append(0, ['(foo)', 'barbar', '(baz)']) + execute "normal gg\2j4lsd" + call g:assert.equals(getline(1), 'foo', 'failed at #365') + call g:assert.equals(getline(2), 'barbar', 'failed at #365') + call g:assert.equals(getline(3), 'baz', 'failed at #365') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #365') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #365') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #365') + + %delete + + " #366 + call append(0, ['foofoo', '(bar)', '(baz)']) + execute "normal gg\2j4lsd" + call g:assert.equals(getline(1), 'foofoo', 'failed at #366') + call g:assert.equals(getline(2), 'bar', 'failed at #366') + call g:assert.equals(getline(3), 'baz', 'failed at #366') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #366') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #366') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #366') + + %delete + + " #367 + call append(0, ['(foo)', '(baar)', '(baaz)']) + execute "normal gg\2j5lsd" + call g:assert.equals(getline(1), 'foo', 'failed at #367') + call g:assert.equals(getline(2), 'baar', 'failed at #367') + call g:assert.equals(getline(3), 'baaz', 'failed at #367') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #367') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #367') + call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #367') + + %delete + + " #368 + call append(0, ['(fooo)', '(bar)', '(baaz)']) + execute "normal gg\2j5lsd" + call g:assert.equals(getline(1), 'fooo', 'failed at #368') + call g:assert.equals(getline(2), 'bar', 'failed at #368') + call g:assert.equals(getline(3), 'baaz', 'failed at #368') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #368') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #368') + call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #368') + + %delete + + " #369 + call append(0, ['(fooo)', '(baar)', '(baz)']) + set virtualedit=block + execute "normal gg\2j5lsd" + call g:assert.equals(getline(1), 'fooo', 'failed at #369') + call g:assert.equals(getline(2), 'baar', 'failed at #369') + call g:assert.equals(getline(3), 'baz', 'failed at #369') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #369') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #369') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #369') + set virtualedit& + + %delete + + """ terminal-extended block-wise visual mode + " #370 + call append(0, ['(fooo)', '(baaar)', '(baz)']) + execute "normal gg\2j$sd" + call g:assert.equals(getline(1), 'fooo', 'failed at #370') + call g:assert.equals(getline(2), 'baaar', 'failed at #370') + call g:assert.equals(getline(3), 'baz', 'failed at #370') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #370') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #370') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #370') + + %delete + + " #371 + call append(0, ['(foooo)', '(bar)', '(baaz)']) + execute "normal gg\2j$sd" + call g:assert.equals(getline(1), 'foooo', 'failed at #371') + call g:assert.equals(getline(2), 'bar', 'failed at #371') + call g:assert.equals(getline(3), 'baaz', 'failed at #371') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #371') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #371') + call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #371') + + %delete + + " #372 + call append(0, ['(fooo)', '', '(baz)']) + execute "normal gg\2j$sd" + call g:assert.equals(getline(1), 'fooo', 'failed at #372') + call g:assert.equals(getline(2), '', 'failed at #372') + call g:assert.equals(getline(3), 'baz', 'failed at #372') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #372') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #372') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #372') +endfunction +"}}} +function! s:suite.blockwise_x_a_character() abort "{{{ + " #373 + call setline('.', '(a)') + execute "normal 0\2lsd" + call g:assert.equals(getline('.'), 'a', 'failed at #373') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #373') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #373') + call g:assert.equals(getpos("']"), [0, 1, 2, 0], 'failed at #373') +endfunction +"}}} +function! s:suite.blockwise_x_nothing_inside() abort "{{{ + " #374 + call append(0, ['()', '()', '()']) + execute "normal gg\2jlsd" + call g:assert.equals(getline(1), '', 'failed at #374') + call g:assert.equals(getline(2), '', 'failed at #374') + call g:assert.equals(getline(3), '', 'failed at #374') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #374') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #374') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #374') + + %delete + + " #375 + call append(0, ['foo()bar', 'foo()bar', 'foo()bar']) + execute "normal gg3l\2jlsd" + call g:assert.equals(getline(1), 'foobar', 'failed at #375') + call g:assert.equals(getline(2), 'foobar', 'failed at #375') + call g:assert.equals(getline(3), 'foobar', 'failed at #375') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #375') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #375') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #375') +endfunction +"}}} +function! s:suite.blockwise_x_count() abort "{{{ + " #376 + call setline('.', '((foo))') + execute "normal 0\6l2sd" + call g:assert.equals(getline('.'), 'foo', 'failed at #376') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #376') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #376') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #376') + + " #377 + call setline('.', '{[(foo)]}') + execute "normal 0\8l3sd" + call g:assert.equals(getline('.'), 'foo', 'failed at #377') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #377') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #377') + call g:assert.equals(getpos("']"), [0, 1, 4, 0], 'failed at #377') + + " #378 + call setline('.', 'foo{[(bar)]}baz') + execute "normal 03l\8l3sd" + call g:assert.equals(getline('.'), 'foobarbaz', 'failed at #378') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #378') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #378') + call g:assert.equals(getpos("']"), [0, 1, 7, 0], 'failed at #378') + + %delete + + " #379 + call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) + execute "normal gg\2j8l3sd" + call g:assert.equals(getline(1), 'foo', 'failed at #379') + call g:assert.equals(getline(2), 'bar', 'failed at #379') + call g:assert.equals(getline(3), 'baz', 'failed at #379') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #379') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #379') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #379') + + %delete + + " #380 + call append(0, ['{[afoob]}', '{[(bar)]}', '{[(baz)]}']) + execute "normal gg\2j8l3sd" + call g:assert.equals(getline(1), 'afoob', 'failed at #380') + call g:assert.equals(getline(2), 'bar', 'failed at #380') + call g:assert.equals(getline(3), 'baz', 'failed at #380') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #380') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #380') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #380') + + %delete + + " #381 + call append(0, ['{[(foo)]}', '{[abarb]}', '{[(baz)]}']) + execute "normal gg\2j8l3sd" + call g:assert.equals(getline(1), 'foo', 'failed at #381') + call g:assert.equals(getline(2), 'abarb', 'failed at #381') + call g:assert.equals(getline(3), 'baz', 'failed at #381') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #381') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #381') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #381') + + %delete + + " #382 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[abazb]}']) execute "normal gg\2j8l3sd" - call g:assert.equals(getline(1), 'foo', 'failed at #362') - call g:assert.equals(getline(2), 'bar', 'failed at #362') - call g:assert.equals(getline(3), 'abazb', 'failed at #362') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #362') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #362') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #362') + call g:assert.equals(getline(1), 'foo', 'failed at #382') + call g:assert.equals(getline(2), 'bar', 'failed at #382') + call g:assert.equals(getline(3), 'abazb', 'failed at #382') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #382') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #382') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #382') endfunction "}}} function! s:suite.blockwise_x_external_textobj() abort"{{{ @@ -4043,40 +4171,40 @@ function! s:suite.blockwise_x_external_textobj() abort"{{{ \ {'external': ['it', 'at']}, \ ] - " #363 + " #383 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal gg2l\2j4lsd" - call g:assert.equals(getline(1), '{[foo]}', 'failed at #363') - call g:assert.equals(getline(2), '{[bar]}', 'failed at #363') - call g:assert.equals(getline(3), '{[baz]}', 'failed at #363') + call g:assert.equals(getline(1), '{[foo]}', 'failed at #383') + call g:assert.equals(getline(2), '{[bar]}', 'failed at #383') + call g:assert.equals(getline(3), '{[baz]}', 'failed at #383') %delete - " #364 + " #384 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl\2j6lsd" - call g:assert.equals(getline(1), '{(foo)}', 'failed at #364') - call g:assert.equals(getline(2), '{(bar)}', 'failed at #364') - call g:assert.equals(getline(3), '{(baz)}', 'failed at #364') + call g:assert.equals(getline(1), '{(foo)}', 'failed at #384') + call g:assert.equals(getline(2), '{(bar)}', 'failed at #384') + call g:assert.equals(getline(3), '{(baz)}', 'failed at #384') %delete - " #365 + " #385 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal gg\2j8lsd" - call g:assert.equals(getline(1), '[(foo)]', 'failed at #365') - call g:assert.equals(getline(2), '[(bar)]', 'failed at #365') - call g:assert.equals(getline(3), '[(baz)]', 'failed at #365') + call g:assert.equals(getline(1), '[(foo)]', 'failed at #385') + call g:assert.equals(getline(2), '[(bar)]', 'failed at #385') + call g:assert.equals(getline(3), '[(baz)]', 'failed at #385') %delete - " #366 + " #386 call setline('.', 'foo') call append(0, ['foo', 'bar', 'baz']) execute "normal gg\2j17lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #366') - call g:assert.equals(getline(2), 'bar', 'failed at #366') - call g:assert.equals(getline(3), 'baz', 'failed at #366') + call g:assert.equals(getline(1), 'foo', 'failed at #386') + call g:assert.equals(getline(2), 'bar', 'failed at #386') + call g:assert.equals(getline(3), 'baz', 'failed at #386') unlet g:sandwich#recipes unlet g:operator#sandwich#recipes @@ -4085,96 +4213,96 @@ endfunction function! s:suite.blockwise_x_option_cursor() abort "{{{ """"" cursor """ inner_head - " #367 + " #387 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl\2j6l2sd" - call g:assert.equals(getline(1), '{foo}', 'failed at #367') - call g:assert.equals(getline(2), '{bar}', 'failed at #367') - call g:assert.equals(getline(3), '{baz}', 'failed at #367') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #367') + call g:assert.equals(getline(1), '{foo}', 'failed at #387') + call g:assert.equals(getline(2), '{bar}', 'failed at #387') + call g:assert.equals(getline(3), '{baz}', 'failed at #387') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #387') - " #368 + " #388 execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #368') - call g:assert.equals(getline(2), 'bar', 'failed at #368') - call g:assert.equals(getline(3), 'baz', 'failed at #368') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #368') + call g:assert.equals(getline(1), 'foo', 'failed at #388') + call g:assert.equals(getline(2), 'bar', 'failed at #388') + call g:assert.equals(getline(3), 'baz', 'failed at #388') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #388') %delete """ keep - " #369 + " #389 call operator#sandwich#set('delete', 'block', 'cursor', 'keep') call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl\2j6l2sd" - call g:assert.equals(getline(1), '{foo}', 'failed at #369') - call g:assert.equals(getline(2), '{bar}', 'failed at #369') - call g:assert.equals(getline(3), '{baz}', 'failed at #369') - call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #369') + call g:assert.equals(getline(1), '{foo}', 'failed at #389') + call g:assert.equals(getline(2), '{bar}', 'failed at #389') + call g:assert.equals(getline(3), '{baz}', 'failed at #389') + call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #389') - " #370 + " #390 execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #370') - call g:assert.equals(getline(2), 'bar', 'failed at #370') - call g:assert.equals(getline(3), 'baz', 'failed at #370') - call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #370') + call g:assert.equals(getline(1), 'foo', 'failed at #390') + call g:assert.equals(getline(2), 'bar', 'failed at #390') + call g:assert.equals(getline(3), 'baz', 'failed at #390') + call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #390') %delete """ inner_tail - " #371 + " #391 call operator#sandwich#set('delete', 'block', 'cursor', 'inner_tail') call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl\2j6l2sd" - call g:assert.equals(getline(1), '{foo}', 'failed at #371') - call g:assert.equals(getline(2), '{bar}', 'failed at #371') - call g:assert.equals(getline(3), '{baz}', 'failed at #371') - call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #371') + call g:assert.equals(getline(1), '{foo}', 'failed at #391') + call g:assert.equals(getline(2), '{bar}', 'failed at #391') + call g:assert.equals(getline(3), '{baz}', 'failed at #391') + call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #391') - " #372 + " #392 execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #372') - call g:assert.equals(getline(2), 'bar', 'failed at #372') - call g:assert.equals(getline(3), 'baz', 'failed at #372') - call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #372') + call g:assert.equals(getline(1), 'foo', 'failed at #392') + call g:assert.equals(getline(2), 'bar', 'failed at #392') + call g:assert.equals(getline(3), 'baz', 'failed at #392') + call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #392') %delete """ head - " #373 + " #393 call operator#sandwich#set('delete', 'block', 'cursor', 'head') call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl\2j6l2sd" - call g:assert.equals(getline(1), '{foo}', 'failed at #373') - call g:assert.equals(getline(2), '{bar}', 'failed at #373') - call g:assert.equals(getline(3), '{baz}', 'failed at #373') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #373') + call g:assert.equals(getline(1), '{foo}', 'failed at #393') + call g:assert.equals(getline(2), '{bar}', 'failed at #393') + call g:assert.equals(getline(3), '{baz}', 'failed at #393') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #393') - " #374 + " #394 execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #374') - call g:assert.equals(getline(2), 'bar', 'failed at #374') - call g:assert.equals(getline(3), 'baz', 'failed at #374') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #374') + call g:assert.equals(getline(1), 'foo', 'failed at #394') + call g:assert.equals(getline(2), 'bar', 'failed at #394') + call g:assert.equals(getline(3), 'baz', 'failed at #394') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #394') %delete """ tail - " #375 + " #395 call operator#sandwich#set('delete', 'block', 'cursor', 'tail') call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal ggl\2j6l2sd" - call g:assert.equals(getline(1), '{foo}', 'failed at #375') - call g:assert.equals(getline(2), '{bar}', 'failed at #375') - call g:assert.equals(getline(3), '{baz}', 'failed at #375') - call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #375') + call g:assert.equals(getline(1), '{foo}', 'failed at #395') + call g:assert.equals(getline(2), '{bar}', 'failed at #395') + call g:assert.equals(getline(3), '{baz}', 'failed at #395') + call g:assert.equals(getpos('.'), [0, 3, 4, 0], 'failed at #395') - " #376 + " #396 execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #376') - call g:assert.equals(getline(2), 'bar', 'failed at #376') - call g:assert.equals(getline(3), 'baz', 'failed at #376') - call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #376') + call g:assert.equals(getline(1), 'foo', 'failed at #396') + call g:assert.equals(getline(2), 'bar', 'failed at #396') + call g:assert.equals(getline(3), 'baz', 'failed at #396') + call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #396') call operator#sandwich#set('delete', 'block', 'cursor', 'inner_head') endfunction @@ -4187,41 +4315,41 @@ function! s:suite.blockwise_x_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #377 + " #397 call append(0, ['{(foo)}', '{(bar)}', '{(baz)}']) execute "normal gg\2j6lsd" - call g:assert.equals(getline(1), '(foo)', 'failed at #377') - call g:assert.equals(getline(2), '(bar)', 'failed at #377') - call g:assert.equals(getline(3), '(baz)', 'failed at #377') + call g:assert.equals(getline(1), '(foo)', 'failed at #397') + call g:assert.equals(getline(2), '(bar)', 'failed at #397') + call g:assert.equals(getline(3), '(baz)', 'failed at #397') %delete - " #378 + " #398 call append(0, ['{(foo)}', '{(bar)}', '{(baz)}']) execute "normal ggl\2j4llsd" - call g:assert.equals(getline(1), '{(foo)}', 'failed at #378') - call g:assert.equals(getline(2), '{(bar)}', 'failed at #378') - call g:assert.equals(getline(3), '{(baz)}', 'failed at #378') + call g:assert.equals(getline(1), '{(foo)}', 'failed at #398') + call g:assert.equals(getline(2), '{(bar)}', 'failed at #398') + call g:assert.equals(getline(3), '{(baz)}', 'failed at #398') %delete """ off - " #379 + " #399 call operator#sandwich#set('delete', 'block', 'noremap', 0) call append(0, ['{(foo)}', '{(bar)}', '{(baz)}']) execute "normal gg\2j6lsd" - call g:assert.equals(getline(1), '{(foo)}', 'failed at #379') - call g:assert.equals(getline(2), '{(bar)}', 'failed at #379') - call g:assert.equals(getline(3), '{(baz)}', 'failed at #379') + call g:assert.equals(getline(1), '{(foo)}', 'failed at #399') + call g:assert.equals(getline(2), '{(bar)}', 'failed at #399') + call g:assert.equals(getline(3), '{(baz)}', 'failed at #399') %delete - " #380 + " #400 call append(0, ['{(foo)}', '{(bar)}', '{(baz)}']) execute "normal ggl\2j4lsd" - call g:assert.equals(getline(1), '{foo}', 'failed at #380') - call g:assert.equals(getline(2), '{bar}', 'failed at #380') - call g:assert.equals(getline(3), '{baz}', 'failed at #380') + call g:assert.equals(getline(1), '{foo}', 'failed at #400') + call g:assert.equals(getline(2), '{bar}', 'failed at #400') + call g:assert.equals(getline(3), '{baz}', 'failed at #400') unlet! g:sandwich#recipes unlet! g:operator#sandwich#recipes @@ -4235,41 +4363,41 @@ function! s:suite.blockwise_x_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #381 + " #401 call append(0, ['\d\+foo\d\+', '\d\+bar\d\+', '\d\+baz\d\+']) execute "normal gg\2j10lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #381') - call g:assert.equals(getline(2), 'bar', 'failed at #381') - call g:assert.equals(getline(3), 'baz', 'failed at #381') + call g:assert.equals(getline(1), 'foo', 'failed at #401') + call g:assert.equals(getline(2), 'bar', 'failed at #401') + call g:assert.equals(getline(3), 'baz', 'failed at #401') %delete - " #382 + " #402 call append(0, ['888foo888', '888bar888', '888baz888']) execute "normal gg\2j8lsd" - call g:assert.equals(getline(1), '88foo88', 'failed at #382') - call g:assert.equals(getline(2), '88bar88', 'failed at #382') - call g:assert.equals(getline(3), '88baz88', 'failed at #382') + call g:assert.equals(getline(1), '88foo88', 'failed at #402') + call g:assert.equals(getline(2), '88bar88', 'failed at #402') + call g:assert.equals(getline(3), '88baz88', 'failed at #402') %delete """ on call operator#sandwich#set('delete', 'block', 'regex', 1) - " #383 + " #403 call append(0, ['\d\+foo\d\+', '\d\+bar\d\+', '\d\+baz\d\+']) execute "normal gg\2j10lsd" - call g:assert.equals(getline(1), '\d\+foo\d\+', 'failed at #383') - call g:assert.equals(getline(2), '\d\+bar\d\+', 'failed at #383') - call g:assert.equals(getline(3), '\d\+baz\d\+', 'failed at #383') + call g:assert.equals(getline(1), '\d\+foo\d\+', 'failed at #403') + call g:assert.equals(getline(2), '\d\+bar\d\+', 'failed at #403') + call g:assert.equals(getline(3), '\d\+baz\d\+', 'failed at #403') %delete - " #384 + " #404 call append(0, ['888foo888', '888bar888', '888baz888']) execute "normal gg\2j8lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #384') - call g:assert.equals(getline(2), 'bar', 'failed at #384') - call g:assert.equals(getline(3), 'baz', 'failed at #384') + call g:assert.equals(getline(1), 'foo', 'failed at #404') + call g:assert.equals(getline(2), 'bar', 'failed at #404') + call g:assert.equals(getline(3), 'baz', 'failed at #404') call operator#sandwich#set('delete', 'block', 'regex', 0) unlet! g:sandwich#recipes @@ -4277,101 +4405,142 @@ function! s:suite.blockwise_x_option_regex() abort "{{{ endfunction "}}} function! s:suite.blockwise_x_option_skip_space() abort "{{{ - """ on - " #385 + """ 1 + " #405 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #385') - call g:assert.equals(getline(2), 'bar', 'failed at #385') - call g:assert.equals(getline(3), 'baz', 'failed at #385') + call g:assert.equals(getline(1), 'foo', 'failed at #405') + call g:assert.equals(getline(2), 'bar', 'failed at #405') + call g:assert.equals(getline(3), 'baz', 'failed at #405') %delete - " #386 + " #406 call append(0, [' "foo"', ' "bar"', ' "baz"']) execute "normal gg0\2j5lsd" - call g:assert.equals(getline(1), ' foo', 'failed at #386') - call g:assert.equals(getline(2), ' bar', 'failed at #386') - call g:assert.equals(getline(3), ' baz', 'failed at #386') + call g:assert.equals(getline(1), ' foo', 'failed at #406') + call g:assert.equals(getline(2), ' bar', 'failed at #406') + call g:assert.equals(getline(3), ' baz', 'failed at #406') %delete - " #387 + " #407 call append(0, ['"foo" ', '"bar" ', '"baz" ']) execute "normal gg\2j5lsd" - call g:assert.equals(getline(1), 'foo ', 'failed at #387') - call g:assert.equals(getline(2), 'bar ', 'failed at #387') - call g:assert.equals(getline(3), 'baz ', 'failed at #387') + call g:assert.equals(getline(1), 'foo ', 'failed at #407') + call g:assert.equals(getline(2), 'bar ', 'failed at #407') + call g:assert.equals(getline(3), 'baz ', 'failed at #407') %delete - " #388 + " #408 " do not skip! call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) execute "normal gg0\2j6lsd" - call g:assert.equals(getline('.'), '"foo"', 'failed at #388') + call g:assert.equals(getline(1), '"foo"', 'failed at #408') + call g:assert.equals(getline(2), '"bar"', 'failed at #408') + call g:assert.equals(getline(3), '"baz"', 'failed at #408') + + %delete + + """ 2 + call operator#sandwich#set('delete', 'block', 'skip_space', 2) + " #409 + call append(0, ['"foo"', '"bar"', '"baz"']) + execute "normal gg\2j4lsd" + call g:assert.equals(getline(1), 'foo', 'failed at #409') + call g:assert.equals(getline(2), 'bar', 'failed at #409') + call g:assert.equals(getline(3), 'baz', 'failed at #409') + + %delete + + " #410 + call append(0, [' "foo"', ' "bar"', ' "baz"']) + execute "normal gg0\2j5lsd" + call g:assert.equals(getline(1), ' foo', 'failed at #410') + call g:assert.equals(getline(2), ' bar', 'failed at #410') + call g:assert.equals(getline(3), ' baz', 'failed at #410') + + %delete + + " #411 + call append(0, ['"foo" ', '"bar" ', '"baz" ']) + execute "normal gg\2j5lsd" + call g:assert.equals(getline(1), 'foo ', 'failed at #411') + call g:assert.equals(getline(2), 'bar ', 'failed at #411') + call g:assert.equals(getline(3), 'baz ', 'failed at #411') + + %delete + + " #412 + " do not skip! + call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) + execute "normal gg0\2j6lsd" + call g:assert.equals(getline(1), ' foo ', 'failed at #412') + call g:assert.equals(getline(2), ' bar ', 'failed at #412') + call g:assert.equals(getline(3), ' baz ', 'failed at #412') %delete """ off call operator#sandwich#set('delete', 'block', 'skip_space', 0) - " #389 + " #413 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), 'foo', 'failed at #389') - call g:assert.equals(getline(2), 'bar', 'failed at #389') - call g:assert.equals(getline(3), 'baz', 'failed at #389') + call g:assert.equals(getline(1), 'foo', 'failed at #413') + call g:assert.equals(getline(2), 'bar', 'failed at #413') + call g:assert.equals(getline(3), 'baz', 'failed at #413') %delete - " #390 + " #414 call append(0, [' "foo"', ' "bar"', ' "baz"']) execute "normal gg0\2j5lsd" - call g:assert.equals(getline(1), ' "foo"', 'failed at #390') - call g:assert.equals(getline(2), ' "bar"', 'failed at #390') - call g:assert.equals(getline(3), ' "baz"', 'failed at #390') + call g:assert.equals(getline(1), ' "foo"', 'failed at #414') + call g:assert.equals(getline(2), ' "bar"', 'failed at #414') + call g:assert.equals(getline(3), ' "baz"', 'failed at #414') %delete - " #391 + " #415 call append(0, ['"foo" ', '"bar" ', '"baz" ']) execute "normal gg\2j5lsd" - call g:assert.equals(getline(1), '"foo" ', 'failed at #391') - call g:assert.equals(getline(2), '"bar" ', 'failed at #391') - call g:assert.equals(getline(3), '"baz" ', 'failed at #391') + call g:assert.equals(getline(1), '"foo" ', 'failed at #415') + call g:assert.equals(getline(2), '"bar" ', 'failed at #415') + call g:assert.equals(getline(3), '"baz" ', 'failed at #415') %delete - " #392 + " #416 " do not skip! call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) execute "normal gg0\2j6lsd" - call g:assert.equals(getline(1), '"foo"', 'failed at #392') - call g:assert.equals(getline(2), '"bar"', 'failed at #392') - call g:assert.equals(getline(3), '"baz"', 'failed at #392') + call g:assert.equals(getline(1), '"foo"', 'failed at #416') + call g:assert.equals(getline(2), '"bar"', 'failed at #416') + call g:assert.equals(getline(3), '"baz"', 'failed at #416') call operator#sandwich#set('delete', 'block', 'skip_space', 1) endfunction "}}} function! s:suite.blockwise_x_option_skip_char() abort "{{{ """ off - " #393 + " #417 call append(0, ['aa(foo)bb', 'aa(bar)bb', 'aa(baz)bb']) execute "normal gg\2j8lsd" - call g:assert.equals(getline(1), 'aa(foo)bb', 'failed at #393') - call g:assert.equals(getline(2), 'aa(bar)bb', 'failed at #393') - call g:assert.equals(getline(3), 'aa(baz)bb', 'failed at #393') + call g:assert.equals(getline(1), 'aa(foo)bb', 'failed at #417') + call g:assert.equals(getline(2), 'aa(bar)bb', 'failed at #417') + call g:assert.equals(getline(3), 'aa(baz)bb', 'failed at #417') %delete """ on call operator#sandwich#set('delete', 'block', 'skip_char', 1) - " #394 + " #418 call append(0, ['aa(foo)bb', 'aa(bar)bb', 'aa(baz)bb']) execute "normal gg\2j8lsd" - call g:assert.equals(getline(1), 'aafoobb', 'failed at #394') - call g:assert.equals(getline(2), 'aabarbb', 'failed at #394') - call g:assert.equals(getline(3), 'aabazbb', 'failed at #394') + call g:assert.equals(getline(1), 'aafoobb', 'failed at #418') + call g:assert.equals(getline(2), 'aabarbb', 'failed at #418') + call g:assert.equals(getline(3), 'aabazbb', 'failed at #418') call operator#sandwich#set('delete', 'block', 'skip_char', 0) endfunction @@ -4379,12 +4548,12 @@ endfunction function! s:suite.blockwise_x_option_command() abort "{{{ call operator#sandwich#set('delete', 'block', 'command', ['normal! `[dv`]']) - " #395 + " #419 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal gg\2j4lsd" - call g:assert.equals(getline(1), '', 'failed at #395') - call g:assert.equals(getline(2), '', 'failed at #395') - call g:assert.equals(getline(3), '', 'failed at #395') + call g:assert.equals(getline(1), '', 'failed at #419') + call g:assert.equals(getline(2), '', 'failed at #419') + call g:assert.equals(getline(3), '', 'failed at #419') call operator#sandwich#set('delete', 'block', 'command', []) endfunction @@ -4398,29 +4567,29 @@ function! s:suite.function_interface() abort "{{{ \ {'buns': ['[', ']']}, \ ] - " #396 + " #420 call setline('.', '(foo)') normal 0sda( - call g:assert.equals(getline('.'), '(foo)', 'failed at #396') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #396') + call g:assert.equals(getline('.'), '(foo)', 'failed at #420') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #420') - " #397 + " #421 call setline('.', '[foo]') normal 0sda[ - call g:assert.equals(getline('.'), 'foo', 'failed at #397') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #397') + call g:assert.equals(getline('.'), 'foo', 'failed at #421') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #421') - " #398 + " #422 call setline('.', '(foo)') normal 0ssda( - call g:assert.equals(getline('.'), 'foo', 'failed at #398') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #398') + call g:assert.equals(getline('.'), 'foo', 'failed at #422') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #422') - " #399 + " #423 call setline('.', '[foo]') normal 0ssda[ - call g:assert.equals(getline('.'), '[foo]', 'failed at #399') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #399') + call g:assert.equals(getline('.'), '[foo]', 'failed at #423') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #423') endfunction "}}} diff --git a/test/operator-replace.vim b/test/operator-replace.vim index 4a31745..402d46d 100644 --- a/test/operator-replace.vim +++ b/test/operator-replace.vim @@ -1882,7 +1882,7 @@ function! s:suite.charwise_n_option_regex() abort "{{{ endfunction "}}} function! s:suite.charwise_n_option_skip_space() abort "{{{ - """ on + """ 1 " #193 call setline('.', '"foo"') normal 0sr$( @@ -1904,8 +1904,8 @@ function! s:suite.charwise_n_option_skip_space() abort "{{{ normal 0sr$( call g:assert.equals(getline('.'), '("foo")', 'failed at #196') - """ off - call operator#sandwich#set('replace', 'char', 'skip_space', 0) + """ 2 + call operator#sandwich#set('replace', 'char', 'skip_space', 2) " #197 call setline('.', '"foo"') normal 0sr$( @@ -1914,35 +1914,57 @@ function! s:suite.charwise_n_option_skip_space() abort "{{{ " #198 call setline('.', ' "foo"') normal 0sr$( - call g:assert.equals(getline('.'), ' "foo"', 'failed at #198') + call g:assert.equals(getline('.'), ' (foo)', 'failed at #198') " #199 call setline('.', '"foo" ') normal 0sr$( - call g:assert.equals(getline('.'), '"foo" ', 'failed at #199') + call g:assert.equals(getline('.'), '(foo) ', 'failed at #199') " #200 + call setline('.', ' "foo" ') + normal 0sr$( + call g:assert.equals(getline('.'), ' (foo) ', 'failed at #200') + + """ 0 + call operator#sandwich#set('replace', 'char', 'skip_space', 0) + " #201 + call setline('.', '"foo"') + normal 0sr$( + call g:assert.equals(getline('.'), '(foo)', 'failed at #201') + + " #202 + call setline('.', ' "foo"') + normal 0sr$( + call g:assert.equals(getline('.'), ' "foo"', 'failed at #202') + + " #203 + call setline('.', '"foo" ') + normal 0sr$( + call g:assert.equals(getline('.'), '"foo" ', 'failed at #203') + + " #204 " do not skip! call setline('.', ' "foo" ') normal 0sr$( - call g:assert.equals(getline('.'), '("foo")', 'failed at #200') + call g:assert.equals(getline('.'), '("foo")', 'failed at #204') call operator#sandwich#set('replace', 'char', 'skip_space', 1) endfunction "}}} function! s:suite.charwise_n_option_skip_char() abort "{{{ """ off - " #201 + " #205 call setline('.', 'aa(foo)bb') normal 0sr$" - call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #201') + call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #205') """ on call operator#sandwich#set('replace', 'char', 'skip_char', 1) - " #202 + " #206 call setline('.', 'aa(foo)bb') normal 0sr$" - call g:assert.equals(getline('.'), 'aa"foo"bb', 'failed at #202') + call g:assert.equals(getline('.'), 'aa"foo"bb', 'failed at #206') call operator#sandwich#set('replace', 'char', 'skip_char', 0) endfunction @@ -1950,10 +1972,10 @@ endfunction function! s:suite.charwise_n_option_command() abort "{{{ call operator#sandwich#set('replace', 'char', 'command', ['normal! `[dv`]']) - " #203 + " #207 call setline('.', '(foo)') normal 0sra(" - call g:assert.equals(getline('.'), '""', 'failed at #203') + call g:assert.equals(getline('.'), '""', 'failed at #207') call operator#sandwich#set('replace', 'char', 'command', []) endfunction @@ -1963,72 +1985,21 @@ function! s:suite.charwise_n_option_linewise() abort "{{{ call operator#sandwich#set('replace', 'char', 'linewise', 1) """ 1 - " #204 + " #208 call append(0, ['(', 'foo', ')']) normal ggsr7l[ - call g:assert.equals(getline(1), '[', 'failed at #204') - call g:assert.equals(getline(2), 'foo', 'failed at #204') - call g:assert.equals(getline(3), ']', 'failed at #204') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #204') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #204') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #204') - - %delete - - " #205 - call append(0, ['( ', 'foo', ' )']) - normal ggsr11l[ - call g:assert.equals(getline(1), '[', 'failed at #205') - call g:assert.equals(getline(2), 'foo', 'failed at #205') - call g:assert.equals(getline(3), ']', 'failed at #205') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #205') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #205') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #205') - - %delete - - " #206 - call append(0, ['(aa', 'foo', 'aa)']) - normal ggsr11l[ - call g:assert.equals(getline(1), '[aa', 'failed at #206') - call g:assert.equals(getline(2), 'foo', 'failed at #206') - call g:assert.equals(getline(3), 'aa]', 'failed at #206') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #206') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #206') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #206') - - %delete - - " #207 - call append(0, ['(aa', 'foo', ')']) - normal ggsr9l[ - call g:assert.equals(getline(1), '[aa', 'failed at #207') - call g:assert.equals(getline(2), 'foo', 'failed at #207') - call g:assert.equals(getline(3), ']', 'failed at #207') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #207') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #207') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #207') - - %delete - - " #208 - call append(0, ['(', 'foo', 'aa)']) - normal ggsr9l[ call g:assert.equals(getline(1), '[', 'failed at #208') call g:assert.equals(getline(2), 'foo', 'failed at #208') - call g:assert.equals(getline(3), 'aa]', 'failed at #208') + call g:assert.equals(getline(3), ']', 'failed at #208') call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #208') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #208') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #208') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #208') %delete - call operator#sandwich#set('replace', 'char', 'linewise', 2) - - """ 2 " #209 - call append(0, ['(', 'foo', ')']) - normal ggsr7l[ + call append(0, ['( ', 'foo', ' )']) + normal ggsr11l[ call g:assert.equals(getline(1), '[', 'failed at #209') call g:assert.equals(getline(2), 'foo', 'failed at #209') call g:assert.equals(getline(3), ']', 'failed at #209') @@ -2039,40 +2010,91 @@ function! s:suite.charwise_n_option_linewise() abort "{{{ %delete " #210 - call append(0, ['( ', 'foo', ' )']) + call append(0, ['(aa', 'foo', 'aa)']) normal ggsr11l[ - call g:assert.equals(getline(1), '[', 'failed at #210') + call g:assert.equals(getline(1), '[aa', 'failed at #210') call g:assert.equals(getline(2), 'foo', 'failed at #210') - call g:assert.equals(getline(3), ']', 'failed at #210') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #210') + call g:assert.equals(getline(3), 'aa]', 'failed at #210') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #210') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #210') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #210') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #210') %delete " #211 - call append(0, ['(aa', 'foo', 'aa)']) - normal ggsr11l[ - call g:assert.equals(getline(1), '[', 'failed at #211') + call append(0, ['(aa', 'foo', ')']) + normal ggsr9l[ + call g:assert.equals(getline(1), '[aa', 'failed at #211') call g:assert.equals(getline(2), 'foo', 'failed at #211') call g:assert.equals(getline(3), ']', 'failed at #211') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #211') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #211') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #211') call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #211') %delete " #212 + call append(0, ['(', 'foo', 'aa)']) + normal ggsr9l[ + call g:assert.equals(getline(1), '[', 'failed at #212') + call g:assert.equals(getline(2), 'foo', 'failed at #212') + call g:assert.equals(getline(3), 'aa]', 'failed at #212') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #212') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #212') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #212') + + %delete + + call operator#sandwich#set('replace', 'char', 'linewise', 2) + + """ 2 + " #213 + call append(0, ['(', 'foo', ')']) + normal ggsr7l[ + call g:assert.equals(getline(1), '[', 'failed at #213') + call g:assert.equals(getline(2), 'foo', 'failed at #213') + call g:assert.equals(getline(3), ']', 'failed at #213') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #213') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #213') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #213') + + %delete + + " #214 + call append(0, ['( ', 'foo', ' )']) + normal ggsr11l[ + call g:assert.equals(getline(1), '[', 'failed at #214') + call g:assert.equals(getline(2), 'foo', 'failed at #214') + call g:assert.equals(getline(3), ']', 'failed at #214') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #214') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #214') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #214') + + %delete + + " #215 + call append(0, ['(aa', 'foo', 'aa)']) + normal ggsr11l[ + call g:assert.equals(getline(1), '[', 'failed at #215') + call g:assert.equals(getline(2), 'foo', 'failed at #215') + call g:assert.equals(getline(3), ']', 'failed at #215') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #215') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #215') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #215') + + %delete + + " #216 " FIXME: I have no idea what is the expexted behavior. call append(0, ['aa', '(foo)', 'bb']) normal ggjsr5l[ - call g:assert.equals(getline(1), 'aa', 'failed at #212') - call g:assert.equals(getline(2), '[', 'failed at #212') - call g:assert.equals(getline(3), 'bb', 'failed at #212') - call g:assert.equals(getline(4), '', 'failed at #212') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #212') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #212') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #212') + call g:assert.equals(getline(1), 'aa', 'failed at #216') + call g:assert.equals(getline(2), '[', 'failed at #216') + call g:assert.equals(getline(3), 'bb', 'failed at #216') + call g:assert.equals(getline(4), '', 'failed at #216') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #216') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #216') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #216') set whichwrap& endfunction @@ -2080,19 +2102,19 @@ endfunction function! s:suite.charwise_n_option_query_once() abort "{{{ """"" query_once """ off - " #213 + " #217 call setline('.', '"""foo"""') normal 03sr$([{ - call g:assert.equals(getline('.'), '([{foo}])', 'failed at #213') + call g:assert.equals(getline('.'), '([{foo}])', 'failed at #217') %delete """ on - " #214 + " #218 call operator#sandwich#set('replace', 'char', 'query_once', 1) call setline('.', '"""foo"""') normal 03sr$( - call g:assert.equals(getline('.'), '(((foo)))', 'failed at #214') + call g:assert.equals(getline('.'), '(((foo)))', 'failed at #218') call operator#sandwich#set('replace', 'char', 'query_once', 0) endfunction @@ -2102,17 +2124,17 @@ function! s:suite.charwise_n_option_expr() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['1+1', '1+2'], 'input':['a']}] """ 0 - " #215 + " #219 call setline('.', '"foo"') normal 0sra"a - call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #215') + call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #219') """ 1 - " #216 + " #220 call operator#sandwich#set('replace', 'char', 'expr', 1) call setline('.', '"foo"') normal 0sra"a - call g:assert.equals(getline('.'), '2foo3', 'failed at #216') + call g:assert.equals(getline('.'), '2foo3', 'failed at #220') """ 2 " This case cannot be tested since this option makes difference only in @@ -2134,129 +2156,44 @@ function! s:suite.charwise_n_option_autoindent() abort "{{{ """ -1 call operator#sandwich#set('replace', 'char', 'autoindent', -1) - " #217 + " #221 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #217') - call g:assert.equals(getline(2), '[', 'failed at #217') - call g:assert.equals(getline(3), 'foo', 'failed at #217') - call g:assert.equals(getline(4), ']', 'failed at #217') - call g:assert.equals(getline(5), '}', 'failed at #217') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #217') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #217') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #217') - call g:assert.equals(&l:autoindent, 0, 'failed at #217') - call g:assert.equals(&l:smartindent, 0, 'failed at #217') - call g:assert.equals(&l:cindent, 0, 'failed at #217') - call g:assert.equals(&l:indentexpr, '', 'failed at #217') + call g:assert.equals(getline(1), ' {', 'failed at #221') + call g:assert.equals(getline(2), '[', 'failed at #221') + call g:assert.equals(getline(3), 'foo', 'failed at #221') + call g:assert.equals(getline(4), ']', 'failed at #221') + call g:assert.equals(getline(5), '}', 'failed at #221') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #221') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #221') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #221') + call g:assert.equals(&l:autoindent, 0, 'failed at #221') + call g:assert.equals(&l:smartindent, 0, 'failed at #221') + call g:assert.equals(&l:cindent, 0, 'failed at #221') + call g:assert.equals(&l:indentexpr, '', 'failed at #221') %delete - " #218 + " #222 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #218') - call g:assert.equals(getline(2), ' [', 'failed at #218') - call g:assert.equals(getline(3), ' foo', 'failed at #218') - call g:assert.equals(getline(4), ' ]', 'failed at #218') - call g:assert.equals(getline(5), ' }', 'failed at #218') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #218') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #218') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #218') - call g:assert.equals(&l:autoindent, 1, 'failed at #218') - call g:assert.equals(&l:smartindent, 0, 'failed at #218') - call g:assert.equals(&l:cindent, 0, 'failed at #218') - call g:assert.equals(&l:indentexpr, '', 'failed at #218') - - %delete - - " #219 - setlocal smartindent - setlocal nocindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #219') - call g:assert.equals(getline(2), ' [', 'failed at #219') - call g:assert.equals(getline(3), ' foo', 'failed at #219') - call g:assert.equals(getline(4), ' ]', 'failed at #219') - call g:assert.equals(getline(5), '}', 'failed at #219') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #219') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #219') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #219') - call g:assert.equals(&l:autoindent, 1, 'failed at #219') - call g:assert.equals(&l:smartindent, 1, 'failed at #219') - call g:assert.equals(&l:cindent, 0, 'failed at #219') - call g:assert.equals(&l:indentexpr, '', 'failed at #219') - - %delete - - " #220 - setlocal cindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^sr2i"a - call g:assert.equals(getline(1), '{', 'failed at #220') - call g:assert.equals(getline(2), ' [', 'failed at #220') - call g:assert.equals(getline(3), ' foo', 'failed at #220') - call g:assert.equals(getline(4), ' ]', 'failed at #220') - call g:assert.equals(getline(5), ' }', 'failed at #220') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #220') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #220') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #220') - call g:assert.equals(&l:autoindent, 1, 'failed at #220') - call g:assert.equals(&l:smartindent, 1, 'failed at #220') - call g:assert.equals(&l:cindent, 1, 'failed at #220') - call g:assert.equals(&l:indentexpr, '', 'failed at #220') - - %delete - - " #221 - setlocal indentexpr=TestIndent() - call setline('.', ' "foo"') - normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #221') - call g:assert.equals(getline(2), ' [', 'failed at #221') - call g:assert.equals(getline(3), ' foo', 'failed at #221') - call g:assert.equals(getline(4), ' ]', 'failed at #221') - call g:assert.equals(getline(5), ' }', 'failed at #221') - " call g:assert.equals(getpos('.'), [0, 3, 17, 0], 'failed at #221') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #221') - " call g:assert.equals(getpos("']"), [0, 5, 18, 0], 'failed at #221') - call g:assert.equals(&l:autoindent, 1, 'failed at #221') - call g:assert.equals(&l:smartindent, 1, 'failed at #221') - call g:assert.equals(&l:cindent, 1, 'failed at #221') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #221') - - %delete - - """ 0 - call operator#sandwich#set('replace', 'char', 'autoindent', 0) - - " #222 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^sr2i"a call g:assert.equals(getline(1), ' {', 'failed at #222') - call g:assert.equals(getline(2), '[', 'failed at #222') - call g:assert.equals(getline(3), 'foo', 'failed at #222') - call g:assert.equals(getline(4), ']', 'failed at #222') - call g:assert.equals(getline(5), '}', 'failed at #222') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #222') + call g:assert.equals(getline(2), ' [', 'failed at #222') + call g:assert.equals(getline(3), ' foo', 'failed at #222') + call g:assert.equals(getline(4), ' ]', 'failed at #222') + call g:assert.equals(getline(5), ' }', 'failed at #222') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #222') " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #222') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #222') - call g:assert.equals(&l:autoindent, 0, 'failed at #222') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #222') + call g:assert.equals(&l:autoindent, 1, 'failed at #222') call g:assert.equals(&l:smartindent, 0, 'failed at #222') call g:assert.equals(&l:cindent, 0, 'failed at #222') call g:assert.equals(&l:indentexpr, '', 'failed at #222') @@ -2264,106 +2201,106 @@ function! s:suite.charwise_n_option_autoindent() abort "{{{ %delete " #223 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #223') - call g:assert.equals(getline(2), '[', 'failed at #223') - call g:assert.equals(getline(3), 'foo', 'failed at #223') - call g:assert.equals(getline(4), ']', 'failed at #223') - call g:assert.equals(getline(5), '}', 'failed at #223') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #223') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #223') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #223') - call g:assert.equals(&l:autoindent, 1, 'failed at #223') - call g:assert.equals(&l:smartindent, 0, 'failed at #223') - call g:assert.equals(&l:cindent, 0, 'failed at #223') - call g:assert.equals(&l:indentexpr, '', 'failed at #223') - - %delete - - " #224 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #224') - call g:assert.equals(getline(2), '[', 'failed at #224') - call g:assert.equals(getline(3), 'foo', 'failed at #224') - call g:assert.equals(getline(4), ']', 'failed at #224') - call g:assert.equals(getline(5), '}', 'failed at #224') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #224') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #224') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #224') - call g:assert.equals(&l:autoindent, 1, 'failed at #224') - call g:assert.equals(&l:smartindent, 1, 'failed at #224') - call g:assert.equals(&l:cindent, 0, 'failed at #224') - call g:assert.equals(&l:indentexpr, '', 'failed at #224') + call g:assert.equals(getline(1), ' {', 'failed at #223') + call g:assert.equals(getline(2), ' [', 'failed at #223') + call g:assert.equals(getline(3), ' foo', 'failed at #223') + call g:assert.equals(getline(4), ' ]', 'failed at #223') + call g:assert.equals(getline(5), '}', 'failed at #223') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #223') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #223') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #223') + call g:assert.equals(&l:autoindent, 1, 'failed at #223') + call g:assert.equals(&l:smartindent, 1, 'failed at #223') + call g:assert.equals(&l:cindent, 0, 'failed at #223') + call g:assert.equals(&l:indentexpr, '', 'failed at #223') %delete - " #225 + " #224 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #225') - call g:assert.equals(getline(2), '[', 'failed at #225') - call g:assert.equals(getline(3), 'foo', 'failed at #225') - call g:assert.equals(getline(4), ']', 'failed at #225') - call g:assert.equals(getline(5), '}', 'failed at #225') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #225') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #225') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #225') - call g:assert.equals(&l:autoindent, 1, 'failed at #225') - call g:assert.equals(&l:smartindent, 1, 'failed at #225') - call g:assert.equals(&l:cindent, 1, 'failed at #225') - call g:assert.equals(&l:indentexpr, '', 'failed at #225') + call g:assert.equals(getline(1), '{', 'failed at #224') + call g:assert.equals(getline(2), ' [', 'failed at #224') + call g:assert.equals(getline(3), ' foo', 'failed at #224') + call g:assert.equals(getline(4), ' ]', 'failed at #224') + call g:assert.equals(getline(5), ' }', 'failed at #224') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #224') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #224') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #224') + call g:assert.equals(&l:autoindent, 1, 'failed at #224') + call g:assert.equals(&l:smartindent, 1, 'failed at #224') + call g:assert.equals(&l:cindent, 1, 'failed at #224') + call g:assert.equals(&l:indentexpr, '', 'failed at #224') %delete - " #226 + " #225 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #226') - call g:assert.equals(getline(2), '[', 'failed at #226') - call g:assert.equals(getline(3), 'foo', 'failed at #226') - call g:assert.equals(getline(4), ']', 'failed at #226') - call g:assert.equals(getline(5), '}', 'failed at #226') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #226') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #226') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #226') - call g:assert.equals(&l:autoindent, 1, 'failed at #226') - call g:assert.equals(&l:smartindent, 1, 'failed at #226') - call g:assert.equals(&l:cindent, 1, 'failed at #226') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #226') + call g:assert.equals(getline(1), ' {', 'failed at #225') + call g:assert.equals(getline(2), ' [', 'failed at #225') + call g:assert.equals(getline(3), ' foo', 'failed at #225') + call g:assert.equals(getline(4), ' ]', 'failed at #225') + call g:assert.equals(getline(5), ' }', 'failed at #225') + " call g:assert.equals(getpos('.'), [0, 3, 17, 0], 'failed at #225') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #225') + " call g:assert.equals(getpos("']"), [0, 5, 18, 0], 'failed at #225') + call g:assert.equals(&l:autoindent, 1, 'failed at #225') + call g:assert.equals(&l:smartindent, 1, 'failed at #225') + call g:assert.equals(&l:cindent, 1, 'failed at #225') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #225') %delete - """ 1 - call operator#sandwich#set('replace', 'char', 'autoindent', 1) + """ 0 + call operator#sandwich#set('replace', 'char', 'autoindent', 0) - " #227 + " #226 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a + call g:assert.equals(getline(1), ' {', 'failed at #226') + call g:assert.equals(getline(2), '[', 'failed at #226') + call g:assert.equals(getline(3), 'foo', 'failed at #226') + call g:assert.equals(getline(4), ']', 'failed at #226') + call g:assert.equals(getline(5), '}', 'failed at #226') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #226') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #226') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #226') + call g:assert.equals(&l:autoindent, 0, 'failed at #226') + call g:assert.equals(&l:smartindent, 0, 'failed at #226') + call g:assert.equals(&l:cindent, 0, 'failed at #226') + call g:assert.equals(&l:indentexpr, '', 'failed at #226') + + %delete + + " #227 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^sr2i"a call g:assert.equals(getline(1), ' {', 'failed at #227') - call g:assert.equals(getline(2), ' [', 'failed at #227') - call g:assert.equals(getline(3), ' foo', 'failed at #227') - call g:assert.equals(getline(4), ' ]', 'failed at #227') - call g:assert.equals(getline(5), ' }', 'failed at #227') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #227') + call g:assert.equals(getline(2), '[', 'failed at #227') + call g:assert.equals(getline(3), 'foo', 'failed at #227') + call g:assert.equals(getline(4), ']', 'failed at #227') + call g:assert.equals(getline(5), '}', 'failed at #227') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #227') " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #227') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #227') - call g:assert.equals(&l:autoindent, 0, 'failed at #227') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #227') + call g:assert.equals(&l:autoindent, 1, 'failed at #227') call g:assert.equals(&l:smartindent, 0, 'failed at #227') call g:assert.equals(&l:cindent, 0, 'failed at #227') call g:assert.equals(&l:indentexpr, '', 'failed at #227') @@ -2371,213 +2308,213 @@ function! s:suite.charwise_n_option_autoindent() abort "{{{ %delete " #228 - setlocal autoindent - setlocal nosmartindent + setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a call g:assert.equals(getline(1), ' {', 'failed at #228') - call g:assert.equals(getline(2), ' [', 'failed at #228') - call g:assert.equals(getline(3), ' foo', 'failed at #228') - call g:assert.equals(getline(4), ' ]', 'failed at #228') - call g:assert.equals(getline(5), ' }', 'failed at #228') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #228') + call g:assert.equals(getline(2), '[', 'failed at #228') + call g:assert.equals(getline(3), 'foo', 'failed at #228') + call g:assert.equals(getline(4), ']', 'failed at #228') + call g:assert.equals(getline(5), '}', 'failed at #228') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #228') " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #228') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #228') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #228') call g:assert.equals(&l:autoindent, 1, 'failed at #228') - call g:assert.equals(&l:smartindent, 0, 'failed at #228') + call g:assert.equals(&l:smartindent, 1, 'failed at #228') call g:assert.equals(&l:cindent, 0, 'failed at #228') call g:assert.equals(&l:indentexpr, '', 'failed at #228') %delete " #229 - setlocal smartindent - setlocal nocindent + setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a call g:assert.equals(getline(1), ' {', 'failed at #229') - call g:assert.equals(getline(2), ' [', 'failed at #229') - call g:assert.equals(getline(3), ' foo', 'failed at #229') - call g:assert.equals(getline(4), ' ]', 'failed at #229') - call g:assert.equals(getline(5), ' }', 'failed at #229') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #229') + call g:assert.equals(getline(2), '[', 'failed at #229') + call g:assert.equals(getline(3), 'foo', 'failed at #229') + call g:assert.equals(getline(4), ']', 'failed at #229') + call g:assert.equals(getline(5), '}', 'failed at #229') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #229') " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #229') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #229') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #229') call g:assert.equals(&l:autoindent, 1, 'failed at #229') call g:assert.equals(&l:smartindent, 1, 'failed at #229') - call g:assert.equals(&l:cindent, 0, 'failed at #229') + call g:assert.equals(&l:cindent, 1, 'failed at #229') call g:assert.equals(&l:indentexpr, '', 'failed at #229') %delete " #230 - setlocal cindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #230') - call g:assert.equals(getline(2), ' [', 'failed at #230') - call g:assert.equals(getline(3), ' foo', 'failed at #230') - call g:assert.equals(getline(4), ' ]', 'failed at #230') - call g:assert.equals(getline(5), ' }', 'failed at #230') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #230') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #230') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #230') - call g:assert.equals(&l:autoindent, 1, 'failed at #230') - call g:assert.equals(&l:smartindent, 1, 'failed at #230') - call g:assert.equals(&l:cindent, 1, 'failed at #230') - call g:assert.equals(&l:indentexpr, '', 'failed at #230') - - %delete - - " #231 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #231') - call g:assert.equals(getline(2), ' [', 'failed at #231') - call g:assert.equals(getline(3), ' foo', 'failed at #231') - call g:assert.equals(getline(4), ' ]', 'failed at #231') - call g:assert.equals(getline(5), ' }', 'failed at #231') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #231') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #231') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #231') - call g:assert.equals(&l:autoindent, 1, 'failed at #231') - call g:assert.equals(&l:smartindent, 1, 'failed at #231') - call g:assert.equals(&l:cindent, 1, 'failed at #231') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #231') + call g:assert.equals(getline(1), ' {', 'failed at #230') + call g:assert.equals(getline(2), '[', 'failed at #230') + call g:assert.equals(getline(3), 'foo', 'failed at #230') + call g:assert.equals(getline(4), ']', 'failed at #230') + call g:assert.equals(getline(5), '}', 'failed at #230') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #230') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #230') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #230') + call g:assert.equals(&l:autoindent, 1, 'failed at #230') + call g:assert.equals(&l:smartindent, 1, 'failed at #230') + call g:assert.equals(&l:cindent, 1, 'failed at #230') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #230') %delete - """ 2 - call operator#sandwich#set('replace', 'char', 'autoindent', 2) + """ 1 + call operator#sandwich#set('replace', 'char', 'autoindent', 1) - " #232 + " #231 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #232') - call g:assert.equals(getline(2), ' [', 'failed at #232') - call g:assert.equals(getline(3), ' foo', 'failed at #232') - call g:assert.equals(getline(4), ' ]', 'failed at #232') - call g:assert.equals(getline(5), '}', 'failed at #232') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #232') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #232') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #232') - call g:assert.equals(&l:autoindent, 0, 'failed at #232') - call g:assert.equals(&l:smartindent, 0, 'failed at #232') - call g:assert.equals(&l:cindent, 0, 'failed at #232') - call g:assert.equals(&l:indentexpr, '', 'failed at #232') + call g:assert.equals(getline(1), ' {', 'failed at #231') + call g:assert.equals(getline(2), ' [', 'failed at #231') + call g:assert.equals(getline(3), ' foo', 'failed at #231') + call g:assert.equals(getline(4), ' ]', 'failed at #231') + call g:assert.equals(getline(5), ' }', 'failed at #231') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #231') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #231') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #231') + call g:assert.equals(&l:autoindent, 0, 'failed at #231') + call g:assert.equals(&l:smartindent, 0, 'failed at #231') + call g:assert.equals(&l:cindent, 0, 'failed at #231') + call g:assert.equals(&l:indentexpr, '', 'failed at #231') %delete - " #233 + " #232 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #233') - call g:assert.equals(getline(2), ' [', 'failed at #233') - call g:assert.equals(getline(3), ' foo', 'failed at #233') - call g:assert.equals(getline(4), ' ]', 'failed at #233') - call g:assert.equals(getline(5), '}', 'failed at #233') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #233') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #233') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #233') - call g:assert.equals(&l:autoindent, 1, 'failed at #233') - call g:assert.equals(&l:smartindent, 0, 'failed at #233') - call g:assert.equals(&l:cindent, 0, 'failed at #233') - call g:assert.equals(&l:indentexpr, '', 'failed at #233') + call g:assert.equals(getline(1), ' {', 'failed at #232') + call g:assert.equals(getline(2), ' [', 'failed at #232') + call g:assert.equals(getline(3), ' foo', 'failed at #232') + call g:assert.equals(getline(4), ' ]', 'failed at #232') + call g:assert.equals(getline(5), ' }', 'failed at #232') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #232') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #232') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #232') + call g:assert.equals(&l:autoindent, 1, 'failed at #232') + call g:assert.equals(&l:smartindent, 0, 'failed at #232') + call g:assert.equals(&l:cindent, 0, 'failed at #232') + call g:assert.equals(&l:indentexpr, '', 'failed at #232') %delete - " #234 + " #233 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #234') - call g:assert.equals(getline(2), ' [', 'failed at #234') - call g:assert.equals(getline(3), ' foo', 'failed at #234') - call g:assert.equals(getline(4), ' ]', 'failed at #234') - call g:assert.equals(getline(5), '}', 'failed at #234') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #234') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #234') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #234') - call g:assert.equals(&l:autoindent, 1, 'failed at #234') - call g:assert.equals(&l:smartindent, 1, 'failed at #234') - call g:assert.equals(&l:cindent, 0, 'failed at #234') - call g:assert.equals(&l:indentexpr, '', 'failed at #234') + call g:assert.equals(getline(1), ' {', 'failed at #233') + call g:assert.equals(getline(2), ' [', 'failed at #233') + call g:assert.equals(getline(3), ' foo', 'failed at #233') + call g:assert.equals(getline(4), ' ]', 'failed at #233') + call g:assert.equals(getline(5), ' }', 'failed at #233') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #233') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #233') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #233') + call g:assert.equals(&l:autoindent, 1, 'failed at #233') + call g:assert.equals(&l:smartindent, 1, 'failed at #233') + call g:assert.equals(&l:cindent, 0, 'failed at #233') + call g:assert.equals(&l:indentexpr, '', 'failed at #233') %delete - " #235 + " #234 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #235') - call g:assert.equals(getline(2), ' [', 'failed at #235') - call g:assert.equals(getline(3), ' foo', 'failed at #235') - call g:assert.equals(getline(4), ' ]', 'failed at #235') - call g:assert.equals(getline(5), '}', 'failed at #235') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #235') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #235') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #235') - call g:assert.equals(&l:autoindent, 1, 'failed at #235') - call g:assert.equals(&l:smartindent, 1, 'failed at #235') - call g:assert.equals(&l:cindent, 1, 'failed at #235') - call g:assert.equals(&l:indentexpr, '', 'failed at #235') + call g:assert.equals(getline(1), ' {', 'failed at #234') + call g:assert.equals(getline(2), ' [', 'failed at #234') + call g:assert.equals(getline(3), ' foo', 'failed at #234') + call g:assert.equals(getline(4), ' ]', 'failed at #234') + call g:assert.equals(getline(5), ' }', 'failed at #234') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #234') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #234') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #234') + call g:assert.equals(&l:autoindent, 1, 'failed at #234') + call g:assert.equals(&l:smartindent, 1, 'failed at #234') + call g:assert.equals(&l:cindent, 1, 'failed at #234') + call g:assert.equals(&l:indentexpr, '', 'failed at #234') %delete - " #236 + " #235 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #236') - call g:assert.equals(getline(2), ' [', 'failed at #236') - call g:assert.equals(getline(3), ' foo', 'failed at #236') - call g:assert.equals(getline(4), ' ]', 'failed at #236') - call g:assert.equals(getline(5), '}', 'failed at #236') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #236') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #236') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #236') - call g:assert.equals(&l:autoindent, 1, 'failed at #236') - call g:assert.equals(&l:smartindent, 1, 'failed at #236') - call g:assert.equals(&l:cindent, 1, 'failed at #236') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #236') + call g:assert.equals(getline(1), ' {', 'failed at #235') + call g:assert.equals(getline(2), ' [', 'failed at #235') + call g:assert.equals(getline(3), ' foo', 'failed at #235') + call g:assert.equals(getline(4), ' ]', 'failed at #235') + call g:assert.equals(getline(5), ' }', 'failed at #235') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #235') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #235') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #235') + call g:assert.equals(&l:autoindent, 1, 'failed at #235') + call g:assert.equals(&l:smartindent, 1, 'failed at #235') + call g:assert.equals(&l:cindent, 1, 'failed at #235') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #235') %delete - """ 3 - call operator#sandwich#set('replace', 'char', 'autoindent', 3) + """ 2 + call operator#sandwich#set('replace', 'char', 'autoindent', 2) - " #237 + " #236 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), '{', 'failed at #237') - call g:assert.equals(getline(2), ' [', 'failed at #237') + call g:assert.equals(getline(1), ' {', 'failed at #236') + call g:assert.equals(getline(2), ' [', 'failed at #236') + call g:assert.equals(getline(3), ' foo', 'failed at #236') + call g:assert.equals(getline(4), ' ]', 'failed at #236') + call g:assert.equals(getline(5), '}', 'failed at #236') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #236') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #236') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #236') + call g:assert.equals(&l:autoindent, 0, 'failed at #236') + call g:assert.equals(&l:smartindent, 0, 'failed at #236') + call g:assert.equals(&l:cindent, 0, 'failed at #236') + call g:assert.equals(&l:indentexpr, '', 'failed at #236') + + %delete + + " #237 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^sr2i"a + call g:assert.equals(getline(1), ' {', 'failed at #237') + call g:assert.equals(getline(2), ' [', 'failed at #237') call g:assert.equals(getline(3), ' foo', 'failed at #237') call g:assert.equals(getline(4), ' ]', 'failed at #237') - call g:assert.equals(getline(5), ' }', 'failed at #237') + call g:assert.equals(getline(5), '}', 'failed at #237') " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #237') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #237') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #237') - call g:assert.equals(&l:autoindent, 0, 'failed at #237') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #237') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #237') + call g:assert.equals(&l:autoindent, 1, 'failed at #237') call g:assert.equals(&l:smartindent, 0, 'failed at #237') call g:assert.equals(&l:cindent, 0, 'failed at #237') call g:assert.equals(&l:indentexpr, '', 'failed at #237') @@ -2585,84 +2522,169 @@ function! s:suite.charwise_n_option_autoindent() abort "{{{ %delete " #238 - setlocal autoindent - setlocal nosmartindent + setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), '{', 'failed at #238') - call g:assert.equals(getline(2), ' [', 'failed at #238') + call g:assert.equals(getline(1), ' {', 'failed at #238') + call g:assert.equals(getline(2), ' [', 'failed at #238') call g:assert.equals(getline(3), ' foo', 'failed at #238') call g:assert.equals(getline(4), ' ]', 'failed at #238') - call g:assert.equals(getline(5), ' }', 'failed at #238') + call g:assert.equals(getline(5), '}', 'failed at #238') " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #238') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #238') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #238') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #238') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #238') call g:assert.equals(&l:autoindent, 1, 'failed at #238') - call g:assert.equals(&l:smartindent, 0, 'failed at #238') + call g:assert.equals(&l:smartindent, 1, 'failed at #238') call g:assert.equals(&l:cindent, 0, 'failed at #238') call g:assert.equals(&l:indentexpr, '', 'failed at #238') %delete " #239 - setlocal smartindent - setlocal nocindent + setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), '{', 'failed at #239') - call g:assert.equals(getline(2), ' [', 'failed at #239') + call g:assert.equals(getline(1), ' {', 'failed at #239') + call g:assert.equals(getline(2), ' [', 'failed at #239') call g:assert.equals(getline(3), ' foo', 'failed at #239') call g:assert.equals(getline(4), ' ]', 'failed at #239') - call g:assert.equals(getline(5), ' }', 'failed at #239') + call g:assert.equals(getline(5), '}', 'failed at #239') " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #239') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #239') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #239') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #239') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #239') call g:assert.equals(&l:autoindent, 1, 'failed at #239') call g:assert.equals(&l:smartindent, 1, 'failed at #239') - call g:assert.equals(&l:cindent, 0, 'failed at #239') + call g:assert.equals(&l:cindent, 1, 'failed at #239') call g:assert.equals(&l:indentexpr, '', 'failed at #239') %delete " #240 + setlocal indentexpr=TestIndent() + call setline('.', ' "foo"') + normal ^sr2i"a + call g:assert.equals(getline(1), ' {', 'failed at #240') + call g:assert.equals(getline(2), ' [', 'failed at #240') + call g:assert.equals(getline(3), ' foo', 'failed at #240') + call g:assert.equals(getline(4), ' ]', 'failed at #240') + call g:assert.equals(getline(5), '}', 'failed at #240') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #240') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #240') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #240') + call g:assert.equals(&l:autoindent, 1, 'failed at #240') + call g:assert.equals(&l:smartindent, 1, 'failed at #240') + call g:assert.equals(&l:cindent, 1, 'failed at #240') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #240') + + %delete + + """ 3 + call operator#sandwich#set('replace', 'char', 'autoindent', 3) + + " #241 + setlocal noautoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^sr2i"a + call g:assert.equals(getline(1), '{', 'failed at #241') + call g:assert.equals(getline(2), ' [', 'failed at #241') + call g:assert.equals(getline(3), ' foo', 'failed at #241') + call g:assert.equals(getline(4), ' ]', 'failed at #241') + call g:assert.equals(getline(5), ' }', 'failed at #241') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #241') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #241') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #241') + call g:assert.equals(&l:autoindent, 0, 'failed at #241') + call g:assert.equals(&l:smartindent, 0, 'failed at #241') + call g:assert.equals(&l:cindent, 0, 'failed at #241') + call g:assert.equals(&l:indentexpr, '', 'failed at #241') + + %delete + + " #242 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^sr2i"a + call g:assert.equals(getline(1), '{', 'failed at #242') + call g:assert.equals(getline(2), ' [', 'failed at #242') + call g:assert.equals(getline(3), ' foo', 'failed at #242') + call g:assert.equals(getline(4), ' ]', 'failed at #242') + call g:assert.equals(getline(5), ' }', 'failed at #242') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #242') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #242') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #242') + call g:assert.equals(&l:autoindent, 1, 'failed at #242') + call g:assert.equals(&l:smartindent, 0, 'failed at #242') + call g:assert.equals(&l:cindent, 0, 'failed at #242') + call g:assert.equals(&l:indentexpr, '', 'failed at #242') + + %delete + + " #243 + setlocal smartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^sr2i"a + call g:assert.equals(getline(1), '{', 'failed at #243') + call g:assert.equals(getline(2), ' [', 'failed at #243') + call g:assert.equals(getline(3), ' foo', 'failed at #243') + call g:assert.equals(getline(4), ' ]', 'failed at #243') + call g:assert.equals(getline(5), ' }', 'failed at #243') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #243') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #243') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #243') + call g:assert.equals(&l:autoindent, 1, 'failed at #243') + call g:assert.equals(&l:smartindent, 1, 'failed at #243') + call g:assert.equals(&l:cindent, 0, 'failed at #243') + call g:assert.equals(&l:indentexpr, '', 'failed at #243') + + %delete + + " #244 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), '{', 'failed at #240') - call g:assert.equals(getline(2), ' [', 'failed at #240') - call g:assert.equals(getline(3), ' foo', 'failed at #240') - call g:assert.equals(getline(4), ' ]', 'failed at #240') - call g:assert.equals(getline(5), ' }', 'failed at #240') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #240') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #240') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #240') - call g:assert.equals(&l:autoindent, 1, 'failed at #240') - call g:assert.equals(&l:smartindent, 1, 'failed at #240') - call g:assert.equals(&l:cindent, 1, 'failed at #240') - call g:assert.equals(&l:indentexpr, '', 'failed at #240') + call g:assert.equals(getline(1), '{', 'failed at #244') + call g:assert.equals(getline(2), ' [', 'failed at #244') + call g:assert.equals(getline(3), ' foo', 'failed at #244') + call g:assert.equals(getline(4), ' ]', 'failed at #244') + call g:assert.equals(getline(5), ' }', 'failed at #244') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #244') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #244') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #244') + call g:assert.equals(&l:autoindent, 1, 'failed at #244') + call g:assert.equals(&l:smartindent, 1, 'failed at #244') + call g:assert.equals(&l:cindent, 1, 'failed at #244') + call g:assert.equals(&l:indentexpr, '', 'failed at #244') %delete - " #241 + " #245 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), '{', 'failed at #241') - call g:assert.equals(getline(2), ' [', 'failed at #241') - call g:assert.equals(getline(3), ' foo', 'failed at #241') - call g:assert.equals(getline(4), ' ]', 'failed at #241') - call g:assert.equals(getline(5), ' }', 'failed at #241') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #241') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #241') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #241') - call g:assert.equals(&l:autoindent, 1, 'failed at #241') - call g:assert.equals(&l:smartindent, 1, 'failed at #241') - call g:assert.equals(&l:cindent, 1, 'failed at #241') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #241') + call g:assert.equals(getline(1), '{', 'failed at #245') + call g:assert.equals(getline(2), ' [', 'failed at #245') + call g:assert.equals(getline(3), ' foo', 'failed at #245') + call g:assert.equals(getline(4), ' ]', 'failed at #245') + call g:assert.equals(getline(5), ' }', 'failed at #245') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #245') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #245') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #245') + call g:assert.equals(&l:autoindent, 1, 'failed at #245') + call g:assert.equals(&l:smartindent, 1, 'failed at #245') + call g:assert.equals(&l:cindent, 1, 'failed at #245') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #245') endfunction "}}} function! s:suite.charwise_n_option_indentkeys() abort "{{{ @@ -2677,7 +2699,7 @@ function! s:suite.charwise_n_option_indentkeys() abort "{{{ """ cinkeys call operator#sandwich#set('replace', 'char', 'autoindent', 3) - " #242 + " #246 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -2685,20 +2707,20 @@ function! s:suite.charwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys', '0{,0},0),:,0#,!^F,e') call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), '{', 'failed at #242') - call g:assert.equals(getline(2), 'foo', 'failed at #242') - call g:assert.equals(getline(3), ' }', 'failed at #242') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #242') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #242') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #242') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #242') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #242') + call g:assert.equals(getline(1), '{', 'failed at #246') + call g:assert.equals(getline(2), 'foo', 'failed at #246') + call g:assert.equals(getline(3), ' }', 'failed at #246') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #246') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #246') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #246') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #246') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #246') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'char', 'autoindent', 3) - " #243 + " #247 setlocal cinkeys=0{,0},0),:,0#,!^F,e setlocal indentkeys& let cinkeys = &l:cinkeys @@ -2706,20 +2728,20 @@ function! s:suite.charwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys+', 'O,o') call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), '{', 'failed at #243') - call g:assert.equals(getline(2), ' foo', 'failed at #243') - call g:assert.equals(getline(3), ' }', 'failed at #243') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #243') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #243') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #243') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #243') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #243') + call g:assert.equals(getline(1), '{', 'failed at #247') + call g:assert.equals(getline(2), ' foo', 'failed at #247') + call g:assert.equals(getline(3), ' }', 'failed at #247') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #247') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #247') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #247') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #247') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #247') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'char', 'autoindent', 3) - " #244 + " #248 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -2727,14 +2749,14 @@ function! s:suite.charwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys-', 'O,o') call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), '{', 'failed at #244') - call g:assert.equals(getline(2), 'foo', 'failed at #244') - call g:assert.equals(getline(3), ' }', 'failed at #244') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #244') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #244') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #244') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #244') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #244') + call g:assert.equals(getline(1), '{', 'failed at #248') + call g:assert.equals(getline(2), 'foo', 'failed at #248') + call g:assert.equals(getline(3), ' }', 'failed at #248') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #248') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #248') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #248') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #248') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #248') %delete call operator#sandwich#set_default() @@ -2743,7 +2765,7 @@ function! s:suite.charwise_n_option_indentkeys() abort "{{{ setlocal indentexpr=TestIndent() call operator#sandwich#set('replace', 'char', 'autoindent', -1) - " #245 + " #249 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -2751,20 +2773,20 @@ function! s:suite.charwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys', '0{,0},0),:,0#,!^F,e') call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #245') - call g:assert.equals(getline(2), 'foo', 'failed at #245') - call g:assert.equals(getline(3), ' }', 'failed at #245') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #245') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #245') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #245') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #245') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #245') + call g:assert.equals(getline(1), ' {', 'failed at #249') + call g:assert.equals(getline(2), 'foo', 'failed at #249') + call g:assert.equals(getline(3), ' }', 'failed at #249') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #249') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #249') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #249') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #249') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #249') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'char', 'autoindent', -1) - " #246 + " #250 setlocal cinkeys& setlocal indentkeys=0{,0},0),:,0#,!^F,e let cinkeys = &l:cinkeys @@ -2772,20 +2794,20 @@ function! s:suite.charwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys+', 'O,o') call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #246') - call g:assert.equals(getline(2), ' foo', 'failed at #246') - call g:assert.equals(getline(3), ' }', 'failed at #246') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #246') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #246') - " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #246') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #246') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #246') + call g:assert.equals(getline(1), ' {', 'failed at #250') + call g:assert.equals(getline(2), ' foo', 'failed at #250') + call g:assert.equals(getline(3), ' }', 'failed at #250') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #250') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #250') + " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #250') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #250') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #250') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'char', 'autoindent', -1) - " #247 + " #251 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -2793,53 +2815,21 @@ function! s:suite.charwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys-', 'O,o') call setline('.', ' "foo"') normal ^sr2i"a - call g:assert.equals(getline(1), ' {', 'failed at #247') - call g:assert.equals(getline(2), 'foo', 'failed at #247') - call g:assert.equals(getline(3), ' }', 'failed at #247') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #247') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #247') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #247') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #247') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #247') + call g:assert.equals(getline(1), ' {', 'failed at #251') + call g:assert.equals(getline(2), 'foo', 'failed at #251') + call g:assert.equals(getline(3), ' }', 'failed at #251') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #251') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #251') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #251') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #251') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #251') endfunction "}}} function! s:suite.charwise_x_default_recipes() abort "{{{ - " #248 - call setline('.', '(foo)') - normal 0va(sr[ - call g:assert.equals(getline('.'), '[foo]', 'failed at #248') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #248') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #248') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #248') - - " #249 - call setline('.', '[foo]') - normal 0va[sr{ - call g:assert.equals(getline('.'), '{foo}', 'failed at #249') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #249') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #249') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #249') - - " #250 - call setline('.', '{foo}') - normal 0va{sr< - call g:assert.equals(getline('.'), '', 'failed at #250') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #250') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #250') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #250') - - " #251 - call setline('.', '') - normal 0va + normal 0va{sr< call g:assert.equals(getline('.'), '', 'failed at #254') call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #254') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #254') @@ -2863,182 +2853,214 @@ function! s:suite.charwise_x_default_recipes() abort "{{{ " #255 call setline('.', '') - normal 0va + call g:assert.equals(getline('.'), '', 'failed at #258') call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #258') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #258') call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #258') " #259 - call setline('.', 'foo(bar)') - normal 0fbva(sr[ - call g:assert.equals(getline('.'), 'foo[bar]', 'failed at #259') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #259') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #259') - call g:assert.equals(getpos("']"), [0, 1, 9, 0], 'failed at #259') - + call setline('.', '') + normal 0vafoo') normal 0v$sr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #281') + call g:assert.equals(getline('.'), '"foo"', 'failed at #285') unlet g:sandwich#recipes unlet g:operator#sandwich#recipes @@ -3130,68 +3152,68 @@ endfunction function! s:suite.charwise_x_option_cursor() abort "{{{ """"" cursor """ inner_head - " #282 + " #286 call setline('.', '(((foo)))') normal 0lv%2sr[[ - call g:assert.equals(getline('.'), '([[foo]])', 'failed at #282') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #282') + call g:assert.equals(getline('.'), '([[foo]])', 'failed at #286') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #286') - " #283 + " #287 normal 0va(sr[ - call g:assert.equals(getline('.'), '[[[foo]]]', 'failed at #283') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #283') + call g:assert.equals(getline('.'), '[[[foo]]]', 'failed at #287') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #287') """ keep - " #284 + " #288 call operator#sandwich#set('replace', 'char', 'cursor', 'keep') call setline('.', '(((foo)))') normal 0lva(2sr[[ - call g:assert.equals(getline('.'), '([[foo]])', 'failed at #284') - call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #284') - - " #285 - normal va(sr[ - call g:assert.equals(getline('.'), '[[[foo]]]', 'failed at #285') - call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #285') - - """ inner_tail - " #286 - call operator#sandwich#set('replace', 'char', 'cursor', 'inner_tail') - call setline('.', '(((foo)))') - normal 0lva(2sr[[ - call g:assert.equals(getline('.'), '([[foo]])', 'failed at #286') - call g:assert.equals(getpos('.'), [0, 1, 6, 0], 'failed at #286') - - " #287 - normal va(sr[ - call g:assert.equals(getline('.'), '[[[foo]]]', 'failed at #287') - call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #287') - - """ head - " #288 - call operator#sandwich#set('replace', 'char', 'cursor', 'head') - call setline('.', '(((foo)))') - normal 0lva(2sr[[ call g:assert.equals(getline('.'), '([[foo]])', 'failed at #288') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #288') + call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #288') " #289 normal va(sr[ call g:assert.equals(getline('.'), '[[[foo]]]', 'failed at #289') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #289') + call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #289') - """ tail + """ inner_tail " #290 - call operator#sandwich#set('replace', 'char', 'cursor', 'tail') + call operator#sandwich#set('replace', 'char', 'cursor', 'inner_tail') call setline('.', '(((foo)))') normal 0lva(2sr[[ call g:assert.equals(getline('.'), '([[foo]])', 'failed at #290') - call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #290') + call g:assert.equals(getpos('.'), [0, 1, 6, 0], 'failed at #290') " #291 normal va(sr[ call g:assert.equals(getline('.'), '[[[foo]]]', 'failed at #291') - call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #291') + call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #291') + + """ head + " #292 + call operator#sandwich#set('replace', 'char', 'cursor', 'head') + call setline('.', '(((foo)))') + normal 0lva(2sr[[ + call g:assert.equals(getline('.'), '([[foo]])', 'failed at #292') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #292') + + " #293 + normal va(sr[ + call g:assert.equals(getline('.'), '[[[foo]]]', 'failed at #293') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #293') + + """ tail + " #294 + call operator#sandwich#set('replace', 'char', 'cursor', 'tail') + call setline('.', '(((foo)))') + normal 0lva(2sr[[ + call g:assert.equals(getline('.'), '([[foo]])', 'failed at #294') + call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #294') + + " #295 + normal va(sr[ + call g:assert.equals(getline('.'), '[[[foo]]]', 'failed at #295') + call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #295') call operator#sandwich#set('replace', 'char', 'cursor', 'inner_head') endfunction @@ -3204,27 +3226,27 @@ function! s:suite.charwise_x_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #292 + " #296 call setline('.', '{(foo)}') normal 0v6lsr" - call g:assert.equals(getline('.'), '"(foo)"', 'failed at #292') + call g:assert.equals(getline('.'), '"(foo)"', 'failed at #296') - " #293 + " #297 call setline('.', '{(foo)}') normal 0lv4lsr" - call g:assert.equals(getline('.'), '{(foo)}', 'failed at #293') + call g:assert.equals(getline('.'), '{(foo)}', 'failed at #297') """ off - " #294 + " #298 call operator#sandwich#set('replace', 'char', 'noremap', 0) call setline('.', '{(foo)}') normal 0v6lsr" - call g:assert.equals(getline('.'), '{(foo)}', 'failed at #294') + call g:assert.equals(getline('.'), '{(foo)}', 'failed at #298') - " #295 + " #299 call setline('.', '{(foo)}') normal 0lv4lsr" - call g:assert.equals(getline('.'), '{"foo"}', 'failed at #295') + call g:assert.equals(getline('.'), '{"foo"}', 'failed at #299') unlet! g:sandwich#recipes unlet! g:operator#sandwich#recipes @@ -3238,27 +3260,27 @@ function! s:suite.charwise_x_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #296 + " #300 call setline('.', '\d\+foo\d\+') normal 0v$sr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #296') + call g:assert.equals(getline('.'), '"foo"', 'failed at #300') - " #297 + " #301 call setline('.', '888foo888') normal 0v$sr" - call g:assert.equals(getline('.'), '"88foo88"', 'failed at #297') + call g:assert.equals(getline('.'), '"88foo88"', 'failed at #301') """ on call operator#sandwich#set('replace', 'char', 'regex', 1) - " #298 + " #302 call setline('.', '\d\+foo\d\+') normal 0v$sr" - call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #298') + call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #302') - " #299 + " #303 call setline('.', '888foo888') normal 0v$sr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #299') + call g:assert.equals(getline('.'), '"foo"', 'failed at #303') call operator#sandwich#set('replace', 'char', 'regex', 0) unlet! g:sandwich#recipes @@ -3266,30 +3288,7 @@ function! s:suite.charwise_x_option_regex() abort "{{{ endfunction "}}} function! s:suite.charwise_x_option_skip_space() abort "{{{ - """ on - " #300 - call setline('.', '"foo"') - normal 0v$sr( - call g:assert.equals(getline('.'), '(foo)', 'failed at #300') - - " #301 - call setline('.', ' "foo"') - normal 0v$sr( - call g:assert.equals(getline('.'), ' (foo)', 'failed at #301') - - " #302 - call setline('.', '"foo" ') - normal 0v$sr( - call g:assert.equals(getline('.'), '(foo) ', 'failed at #302') - - " #303 - " do not skip! - call setline('.', ' "foo" ') - normal 0v$sr( - call g:assert.equals(getline('.'), '("foo")', 'failed at #303') - - """ off - call operator#sandwich#set('replace', 'char', 'skip_space', 0) + """ 1 " #304 call setline('.', '"foo"') normal 0v$sr( @@ -3298,12 +3297,12 @@ function! s:suite.charwise_x_option_skip_space() abort "{{{ " #305 call setline('.', ' "foo"') normal 0v$sr( - call g:assert.equals(getline('.'), ' "foo"', 'failed at #305') + call g:assert.equals(getline('.'), ' (foo)', 'failed at #305') " #306 call setline('.', '"foo" ') normal 0v$sr( - call g:assert.equals(getline('.'), '"foo" ', 'failed at #306') + call g:assert.equals(getline('.'), '(foo) ', 'failed at #306') " #307 " do not skip! @@ -3311,22 +3310,67 @@ function! s:suite.charwise_x_option_skip_space() abort "{{{ normal 0v$sr( call g:assert.equals(getline('.'), '("foo")', 'failed at #307') + """ 2 + call operator#sandwich#set('replace', 'char', 'skip_space', 2) + " #308 + call setline('.', '"foo"') + normal 0v$sr( + call g:assert.equals(getline('.'), '(foo)', 'failed at #308') + + " #309 + call setline('.', ' "foo"') + normal 0v$sr( + call g:assert.equals(getline('.'), ' (foo)', 'failed at #309') + + " #310 + call setline('.', '"foo" ') + normal 0v$sr( + call g:assert.equals(getline('.'), '(foo) ', 'failed at #310') + + " #311 + call setline('.', ' "foo" ') + normal 0v$sr( + call g:assert.equals(getline('.'), ' (foo) ', 'failed at #311') + + """ 0 + call operator#sandwich#set('replace', 'char', 'skip_space', 0) + " #312 + call setline('.', '"foo"') + normal 0v$sr( + call g:assert.equals(getline('.'), '(foo)', 'failed at #312') + + " #313 + call setline('.', ' "foo"') + normal 0v$sr( + call g:assert.equals(getline('.'), ' "foo"', 'failed at #313') + + " #314 + call setline('.', '"foo" ') + normal 0v$sr( + call g:assert.equals(getline('.'), '"foo" ', 'failed at #314') + + " #315 + " do not skip! + call setline('.', ' "foo" ') + normal 0v$sr( + call g:assert.equals(getline('.'), '("foo")', 'failed at #315') + call operator#sandwich#set('replace', 'char', 'skip_space', 1) endfunction "}}} function! s:suite.charwise_x_option_skip_char() abort "{{{ """ off - " #308 + " #316 call setline('.', 'aa(foo)bb') normal 0v$sr" - call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #308') + call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #316') """ on call operator#sandwich#set('replace', 'char', 'skip_char', 1) - " #309 + " #317 call setline('.', 'aa(foo)bb') normal 0v$sr" - call g:assert.equals(getline('.'), 'aa"foo"bb', 'failed at #309') + call g:assert.equals(getline('.'), 'aa"foo"bb', 'failed at #317') call operator#sandwich#set('replace', 'char', 'skip_char', 0) endfunction @@ -3334,10 +3378,10 @@ endfunction function! s:suite.charwise_x_option_command() abort "{{{ call operator#sandwich#set('replace', 'char', 'command', ['normal! `[dv`]']) - " #310 + " #318 call setline('.', '(foo)') normal 0va(sr" - call g:assert.equals(getline('.'), '""', 'failed at #310') + call g:assert.equals(getline('.'), '""', 'failed at #318') call operator#sandwich#set('replace', 'char', 'command', []) endfunction @@ -3347,116 +3391,116 @@ function! s:suite.charwise_x_option_linewise() abort "{{{ call operator#sandwich#set('replace', 'char', 'linewise', 1) """ 1 - " #311 + " #319 call append(0, ['(', 'foo', ')']) normal ggv6lsr[ - call g:assert.equals(getline(1), '[', 'failed at #311') - call g:assert.equals(getline(2), 'foo', 'failed at #311') - call g:assert.equals(getline(3), ']', 'failed at #311') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #311') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #311') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #311') + call g:assert.equals(getline(1), '[', 'failed at #319') + call g:assert.equals(getline(2), 'foo', 'failed at #319') + call g:assert.equals(getline(3), ']', 'failed at #319') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #319') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #319') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #319') %delete - " #312 + " #320 call append(0, ['( ', 'foo', ' )']) normal ggv10lsr[ - call g:assert.equals(getline(1), '[', 'failed at #312') - call g:assert.equals(getline(2), 'foo', 'failed at #312') - call g:assert.equals(getline(3), ']', 'failed at #312') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #312') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #312') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #312') + call g:assert.equals(getline(1), '[', 'failed at #320') + call g:assert.equals(getline(2), 'foo', 'failed at #320') + call g:assert.equals(getline(3), ']', 'failed at #320') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #320') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #320') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #320') %delete - " #313 + " #321 call append(0, ['(aa', 'foo', 'aa)']) normal ggv10lsr[ - call g:assert.equals(getline(1), '[aa', 'failed at #313') - call g:assert.equals(getline(2), 'foo', 'failed at #313') - call g:assert.equals(getline(3), 'aa]', 'failed at #313') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #313') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #313') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #313') + call g:assert.equals(getline(1), '[aa', 'failed at #321') + call g:assert.equals(getline(2), 'foo', 'failed at #321') + call g:assert.equals(getline(3), 'aa]', 'failed at #321') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #321') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #321') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #321') %delete - " #314 + " #322 call append(0, ['(aa', 'foo', ')']) normal ggv8lsr[ - call g:assert.equals(getline(1), '[aa', 'failed at #314') - call g:assert.equals(getline(2), 'foo', 'failed at #314') - call g:assert.equals(getline(3), ']', 'failed at #314') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #314') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #314') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #314') + call g:assert.equals(getline(1), '[aa', 'failed at #322') + call g:assert.equals(getline(2), 'foo', 'failed at #322') + call g:assert.equals(getline(3), ']', 'failed at #322') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #322') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #322') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #322') %delete - " #315 + " #323 call append(0, ['(', 'foo', 'aa)']) normal ggv8lsr[ - call g:assert.equals(getline(1), '[', 'failed at #315') - call g:assert.equals(getline(2), 'foo', 'failed at #315') - call g:assert.equals(getline(3), 'aa]', 'failed at #315') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #315') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #315') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #315') + call g:assert.equals(getline(1), '[', 'failed at #323') + call g:assert.equals(getline(2), 'foo', 'failed at #323') + call g:assert.equals(getline(3), 'aa]', 'failed at #323') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #323') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #323') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #323') %delete call operator#sandwich#set('replace', 'char', 'linewise', 2) """ 2 - " #316 + " #324 call append(0, ['(', 'foo', ')']) normal ggv6lsr[ - call g:assert.equals(getline(1), '[', 'failed at #316') - call g:assert.equals(getline(2), 'foo', 'failed at #316') - call g:assert.equals(getline(3), ']', 'failed at #316') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #316') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #316') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #316') + call g:assert.equals(getline(1), '[', 'failed at #324') + call g:assert.equals(getline(2), 'foo', 'failed at #324') + call g:assert.equals(getline(3), ']', 'failed at #324') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #324') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #324') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #324') %delete - " #317 + " #325 call append(0, ['( ', 'foo', ' )']) normal ggv10lsr[ - call g:assert.equals(getline(1), '[', 'failed at #317') - call g:assert.equals(getline(2), 'foo', 'failed at #317') - call g:assert.equals(getline(3), ']', 'failed at #317') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #317') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #317') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #317') + call g:assert.equals(getline(1), '[', 'failed at #325') + call g:assert.equals(getline(2), 'foo', 'failed at #325') + call g:assert.equals(getline(3), ']', 'failed at #325') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #325') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #325') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #325') %delete - " #318 + " #326 call append(0, ['(aa', 'foo', 'aa)']) normal ggv10lsr[ - call g:assert.equals(getline(1), '[', 'failed at #318') - call g:assert.equals(getline(2), 'foo', 'failed at #318') - call g:assert.equals(getline(3), ']', 'failed at #318') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #318') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #318') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #318') + call g:assert.equals(getline(1), '[', 'failed at #326') + call g:assert.equals(getline(2), 'foo', 'failed at #326') + call g:assert.equals(getline(3), ']', 'failed at #326') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #326') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #326') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #326') %delete - " #319 + " #327 " FIXME: I have no idea what is the expexted behavior. call append(0, ['aa', '(foo)', 'bb']) normal ggjv4lsr[ - call g:assert.equals(getline(1), 'aa', 'failed at #319') - call g:assert.equals(getline(2), '[', 'failed at #319') - call g:assert.equals(getline(3), 'bb', 'failed at #319') - call g:assert.equals(getline(4), '', 'failed at #319') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #319') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #319') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #319') + call g:assert.equals(getline(1), 'aa', 'failed at #327') + call g:assert.equals(getline(2), '[', 'failed at #327') + call g:assert.equals(getline(3), 'bb', 'failed at #327') + call g:assert.equals(getline(4), '', 'failed at #327') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #327') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #327') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #327') set whichwrap& endfunction @@ -3473,180 +3517,10 @@ function! s:suite.charwise_x_option_autoindent() abort "{{{ """ -1 call operator#sandwich#set('replace', 'char', 'autoindent', -1) - " #320 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #320') - call g:assert.equals(getline(2), '[', 'failed at #320') - call g:assert.equals(getline(3), 'foo', 'failed at #320') - call g:assert.equals(getline(4), ']', 'failed at #320') - call g:assert.equals(getline(5), '}', 'failed at #320') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #320') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #320') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #320') - call g:assert.equals(&l:autoindent, 0, 'failed at #320') - call g:assert.equals(&l:smartindent, 0, 'failed at #320') - call g:assert.equals(&l:cindent, 0, 'failed at #320') - call g:assert.equals(&l:indentexpr, '', 'failed at #320') - - %delete - - " #321 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #321') - call g:assert.equals(getline(2), ' [', 'failed at #321') - call g:assert.equals(getline(3), ' foo', 'failed at #321') - call g:assert.equals(getline(4), ' ]', 'failed at #321') - call g:assert.equals(getline(5), ' }', 'failed at #321') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #321') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #321') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #321') - call g:assert.equals(&l:autoindent, 1, 'failed at #321') - call g:assert.equals(&l:smartindent, 0, 'failed at #321') - call g:assert.equals(&l:cindent, 0, 'failed at #321') - call g:assert.equals(&l:indentexpr, '', 'failed at #321') - - %delete - - " #322 - setlocal smartindent - setlocal nocindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #322') - call g:assert.equals(getline(2), ' [', 'failed at #322') - call g:assert.equals(getline(3), ' foo', 'failed at #322') - call g:assert.equals(getline(4), ' ]', 'failed at #322') - call g:assert.equals(getline(5), '}', 'failed at #322') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #322') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #322') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #322') - call g:assert.equals(&l:autoindent, 1, 'failed at #322') - call g:assert.equals(&l:smartindent, 1, 'failed at #322') - call g:assert.equals(&l:cindent, 0, 'failed at #322') - call g:assert.equals(&l:indentexpr, '', 'failed at #322') - - %delete - - " #323 - setlocal cindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^v2i"sra - call g:assert.equals(getline(1), '{', 'failed at #323') - call g:assert.equals(getline(2), ' [', 'failed at #323') - call g:assert.equals(getline(3), ' foo', 'failed at #323') - call g:assert.equals(getline(4), ' ]', 'failed at #323') - call g:assert.equals(getline(5), ' }', 'failed at #323') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #323') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #323') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #323') - call g:assert.equals(&l:autoindent, 1, 'failed at #323') - call g:assert.equals(&l:smartindent, 1, 'failed at #323') - call g:assert.equals(&l:cindent, 1, 'failed at #323') - call g:assert.equals(&l:indentexpr, '', 'failed at #323') - - %delete - - " #324 - setlocal indentexpr=TestIndent() - call setline('.', ' "foo"') - normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #324') - call g:assert.equals(getline(2), ' [', 'failed at #324') - call g:assert.equals(getline(3), ' foo', 'failed at #324') - call g:assert.equals(getline(4), ' ]', 'failed at #324') - call g:assert.equals(getline(5), ' }', 'failed at #324') - " call g:assert.equals(getpos('.'), [0, 3, 17, 0], 'failed at #324') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #324') - " call g:assert.equals(getpos("']"), [0, 5, 18, 0], 'failed at #324') - call g:assert.equals(&l:autoindent, 1, 'failed at #324') - call g:assert.equals(&l:smartindent, 1, 'failed at #324') - call g:assert.equals(&l:cindent, 1, 'failed at #324') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #324') - - %delete - - """ 0 - call operator#sandwich#set('replace', 'char', 'autoindent', 0) - - " #325 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #325') - call g:assert.equals(getline(2), '[', 'failed at #325') - call g:assert.equals(getline(3), 'foo', 'failed at #325') - call g:assert.equals(getline(4), ']', 'failed at #325') - call g:assert.equals(getline(5), '}', 'failed at #325') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #325') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #325') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #325') - call g:assert.equals(&l:autoindent, 0, 'failed at #325') - call g:assert.equals(&l:smartindent, 0, 'failed at #325') - call g:assert.equals(&l:cindent, 0, 'failed at #325') - call g:assert.equals(&l:indentexpr, '', 'failed at #325') - - %delete - - " #326 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #326') - call g:assert.equals(getline(2), '[', 'failed at #326') - call g:assert.equals(getline(3), 'foo', 'failed at #326') - call g:assert.equals(getline(4), ']', 'failed at #326') - call g:assert.equals(getline(5), '}', 'failed at #326') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #326') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #326') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #326') - call g:assert.equals(&l:autoindent, 1, 'failed at #326') - call g:assert.equals(&l:smartindent, 0, 'failed at #326') - call g:assert.equals(&l:cindent, 0, 'failed at #326') - call g:assert.equals(&l:indentexpr, '', 'failed at #326') - - %delete - - " #327 - setlocal smartindent - setlocal nocindent - setlocal indentexpr= - call setline('.', ' "foo"') - normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #327') - call g:assert.equals(getline(2), '[', 'failed at #327') - call g:assert.equals(getline(3), 'foo', 'failed at #327') - call g:assert.equals(getline(4), ']', 'failed at #327') - call g:assert.equals(getline(5), '}', 'failed at #327') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #327') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #327') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #327') - call g:assert.equals(&l:autoindent, 1, 'failed at #327') - call g:assert.equals(&l:smartindent, 1, 'failed at #327') - call g:assert.equals(&l:cindent, 0, 'failed at #327') - call g:assert.equals(&l:indentexpr, '', 'failed at #327') - - %delete - " #328 - setlocal cindent + setlocal noautoindent + setlocal nosmartindent + setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra @@ -3658,350 +3532,520 @@ function! s:suite.charwise_x_option_autoindent() abort "{{{ " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #328') " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #328') " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #328') - call g:assert.equals(&l:autoindent, 1, 'failed at #328') - call g:assert.equals(&l:smartindent, 1, 'failed at #328') - call g:assert.equals(&l:cindent, 1, 'failed at #328') + call g:assert.equals(&l:autoindent, 0, 'failed at #328') + call g:assert.equals(&l:smartindent, 0, 'failed at #328') + call g:assert.equals(&l:cindent, 0, 'failed at #328') call g:assert.equals(&l:indentexpr, '', 'failed at #328') %delete " #329 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^v2i"sra + call g:assert.equals(getline(1), ' {', 'failed at #329') + call g:assert.equals(getline(2), ' [', 'failed at #329') + call g:assert.equals(getline(3), ' foo', 'failed at #329') + call g:assert.equals(getline(4), ' ]', 'failed at #329') + call g:assert.equals(getline(5), ' }', 'failed at #329') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #329') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #329') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #329') + call g:assert.equals(&l:autoindent, 1, 'failed at #329') + call g:assert.equals(&l:smartindent, 0, 'failed at #329') + call g:assert.equals(&l:cindent, 0, 'failed at #329') + call g:assert.equals(&l:indentexpr, '', 'failed at #329') + + %delete + + " #330 + setlocal smartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^v2i"sra + call g:assert.equals(getline(1), ' {', 'failed at #330') + call g:assert.equals(getline(2), ' [', 'failed at #330') + call g:assert.equals(getline(3), ' foo', 'failed at #330') + call g:assert.equals(getline(4), ' ]', 'failed at #330') + call g:assert.equals(getline(5), '}', 'failed at #330') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #330') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #330') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #330') + call g:assert.equals(&l:autoindent, 1, 'failed at #330') + call g:assert.equals(&l:smartindent, 1, 'failed at #330') + call g:assert.equals(&l:cindent, 0, 'failed at #330') + call g:assert.equals(&l:indentexpr, '', 'failed at #330') + + %delete + + " #331 + setlocal cindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^v2i"sra + call g:assert.equals(getline(1), '{', 'failed at #331') + call g:assert.equals(getline(2), ' [', 'failed at #331') + call g:assert.equals(getline(3), ' foo', 'failed at #331') + call g:assert.equals(getline(4), ' ]', 'failed at #331') + call g:assert.equals(getline(5), ' }', 'failed at #331') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #331') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #331') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #331') + call g:assert.equals(&l:autoindent, 1, 'failed at #331') + call g:assert.equals(&l:smartindent, 1, 'failed at #331') + call g:assert.equals(&l:cindent, 1, 'failed at #331') + call g:assert.equals(&l:indentexpr, '', 'failed at #331') + + %delete + + " #332 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #329') - call g:assert.equals(getline(2), '[', 'failed at #329') - call g:assert.equals(getline(3), 'foo', 'failed at #329') - call g:assert.equals(getline(4), ']', 'failed at #329') - call g:assert.equals(getline(5), '}', 'failed at #329') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #329') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #329') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #329') - call g:assert.equals(&l:autoindent, 1, 'failed at #329') - call g:assert.equals(&l:smartindent, 1, 'failed at #329') - call g:assert.equals(&l:cindent, 1, 'failed at #329') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #329') + call g:assert.equals(getline(1), ' {', 'failed at #332') + call g:assert.equals(getline(2), ' [', 'failed at #332') + call g:assert.equals(getline(3), ' foo', 'failed at #332') + call g:assert.equals(getline(4), ' ]', 'failed at #332') + call g:assert.equals(getline(5), ' }', 'failed at #332') + " call g:assert.equals(getpos('.'), [0, 3, 17, 0], 'failed at #332') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #332') + " call g:assert.equals(getpos("']"), [0, 5, 18, 0], 'failed at #332') + call g:assert.equals(&l:autoindent, 1, 'failed at #332') + call g:assert.equals(&l:smartindent, 1, 'failed at #332') + call g:assert.equals(&l:cindent, 1, 'failed at #332') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #332') + + %delete + + """ 0 + call operator#sandwich#set('replace', 'char', 'autoindent', 0) + + " #333 + setlocal noautoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^v2i"sra + call g:assert.equals(getline(1), ' {', 'failed at #333') + call g:assert.equals(getline(2), '[', 'failed at #333') + call g:assert.equals(getline(3), 'foo', 'failed at #333') + call g:assert.equals(getline(4), ']', 'failed at #333') + call g:assert.equals(getline(5), '}', 'failed at #333') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #333') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #333') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #333') + call g:assert.equals(&l:autoindent, 0, 'failed at #333') + call g:assert.equals(&l:smartindent, 0, 'failed at #333') + call g:assert.equals(&l:cindent, 0, 'failed at #333') + call g:assert.equals(&l:indentexpr, '', 'failed at #333') + + %delete + + " #334 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^v2i"sra + call g:assert.equals(getline(1), ' {', 'failed at #334') + call g:assert.equals(getline(2), '[', 'failed at #334') + call g:assert.equals(getline(3), 'foo', 'failed at #334') + call g:assert.equals(getline(4), ']', 'failed at #334') + call g:assert.equals(getline(5), '}', 'failed at #334') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #334') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #334') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #334') + call g:assert.equals(&l:autoindent, 1, 'failed at #334') + call g:assert.equals(&l:smartindent, 0, 'failed at #334') + call g:assert.equals(&l:cindent, 0, 'failed at #334') + call g:assert.equals(&l:indentexpr, '', 'failed at #334') + + %delete + + " #335 + setlocal smartindent + setlocal nocindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^v2i"sra + call g:assert.equals(getline(1), ' {', 'failed at #335') + call g:assert.equals(getline(2), '[', 'failed at #335') + call g:assert.equals(getline(3), 'foo', 'failed at #335') + call g:assert.equals(getline(4), ']', 'failed at #335') + call g:assert.equals(getline(5), '}', 'failed at #335') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #335') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #335') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #335') + call g:assert.equals(&l:autoindent, 1, 'failed at #335') + call g:assert.equals(&l:smartindent, 1, 'failed at #335') + call g:assert.equals(&l:cindent, 0, 'failed at #335') + call g:assert.equals(&l:indentexpr, '', 'failed at #335') + + %delete + + " #336 + setlocal cindent + setlocal indentexpr= + call setline('.', ' "foo"') + normal ^v2i"sra + call g:assert.equals(getline(1), ' {', 'failed at #336') + call g:assert.equals(getline(2), '[', 'failed at #336') + call g:assert.equals(getline(3), 'foo', 'failed at #336') + call g:assert.equals(getline(4), ']', 'failed at #336') + call g:assert.equals(getline(5), '}', 'failed at #336') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #336') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #336') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #336') + call g:assert.equals(&l:autoindent, 1, 'failed at #336') + call g:assert.equals(&l:smartindent, 1, 'failed at #336') + call g:assert.equals(&l:cindent, 1, 'failed at #336') + call g:assert.equals(&l:indentexpr, '', 'failed at #336') + + %delete + + " #337 + setlocal indentexpr=TestIndent() + call setline('.', ' "foo"') + normal ^v2i"sra + call g:assert.equals(getline(1), ' {', 'failed at #337') + call g:assert.equals(getline(2), '[', 'failed at #337') + call g:assert.equals(getline(3), 'foo', 'failed at #337') + call g:assert.equals(getline(4), ']', 'failed at #337') + call g:assert.equals(getline(5), '}', 'failed at #337') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #337') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #337') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #337') + call g:assert.equals(&l:autoindent, 1, 'failed at #337') + call g:assert.equals(&l:smartindent, 1, 'failed at #337') + call g:assert.equals(&l:cindent, 1, 'failed at #337') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #337') %delete """ 1 call operator#sandwich#set('replace', 'char', 'autoindent', 1) - " #330 + " #338 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #330') - call g:assert.equals(getline(2), ' [', 'failed at #330') - call g:assert.equals(getline(3), ' foo', 'failed at #330') - call g:assert.equals(getline(4), ' ]', 'failed at #330') - call g:assert.equals(getline(5), ' }', 'failed at #330') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #330') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #330') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #330') - call g:assert.equals(&l:autoindent, 0, 'failed at #330') - call g:assert.equals(&l:smartindent, 0, 'failed at #330') - call g:assert.equals(&l:cindent, 0, 'failed at #330') - call g:assert.equals(&l:indentexpr, '', 'failed at #330') + call g:assert.equals(getline(1), ' {', 'failed at #338') + call g:assert.equals(getline(2), ' [', 'failed at #338') + call g:assert.equals(getline(3), ' foo', 'failed at #338') + call g:assert.equals(getline(4), ' ]', 'failed at #338') + call g:assert.equals(getline(5), ' }', 'failed at #338') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #338') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #338') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #338') + call g:assert.equals(&l:autoindent, 0, 'failed at #338') + call g:assert.equals(&l:smartindent, 0, 'failed at #338') + call g:assert.equals(&l:cindent, 0, 'failed at #338') + call g:assert.equals(&l:indentexpr, '', 'failed at #338') %delete - " #331 + " #339 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #331') - call g:assert.equals(getline(2), ' [', 'failed at #331') - call g:assert.equals(getline(3), ' foo', 'failed at #331') - call g:assert.equals(getline(4), ' ]', 'failed at #331') - call g:assert.equals(getline(5), ' }', 'failed at #331') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #331') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #331') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #331') - call g:assert.equals(&l:autoindent, 1, 'failed at #331') - call g:assert.equals(&l:smartindent, 0, 'failed at #331') - call g:assert.equals(&l:cindent, 0, 'failed at #331') - call g:assert.equals(&l:indentexpr, '', 'failed at #331') + call g:assert.equals(getline(1), ' {', 'failed at #339') + call g:assert.equals(getline(2), ' [', 'failed at #339') + call g:assert.equals(getline(3), ' foo', 'failed at #339') + call g:assert.equals(getline(4), ' ]', 'failed at #339') + call g:assert.equals(getline(5), ' }', 'failed at #339') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #339') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #339') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #339') + call g:assert.equals(&l:autoindent, 1, 'failed at #339') + call g:assert.equals(&l:smartindent, 0, 'failed at #339') + call g:assert.equals(&l:cindent, 0, 'failed at #339') + call g:assert.equals(&l:indentexpr, '', 'failed at #339') %delete - " #332 + " #340 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #332') - call g:assert.equals(getline(2), ' [', 'failed at #332') - call g:assert.equals(getline(3), ' foo', 'failed at #332') - call g:assert.equals(getline(4), ' ]', 'failed at #332') - call g:assert.equals(getline(5), ' }', 'failed at #332') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #332') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #332') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #332') - call g:assert.equals(&l:autoindent, 1, 'failed at #332') - call g:assert.equals(&l:smartindent, 1, 'failed at #332') - call g:assert.equals(&l:cindent, 0, 'failed at #332') - call g:assert.equals(&l:indentexpr, '', 'failed at #332') + call g:assert.equals(getline(1), ' {', 'failed at #340') + call g:assert.equals(getline(2), ' [', 'failed at #340') + call g:assert.equals(getline(3), ' foo', 'failed at #340') + call g:assert.equals(getline(4), ' ]', 'failed at #340') + call g:assert.equals(getline(5), ' }', 'failed at #340') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #340') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #340') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #340') + call g:assert.equals(&l:autoindent, 1, 'failed at #340') + call g:assert.equals(&l:smartindent, 1, 'failed at #340') + call g:assert.equals(&l:cindent, 0, 'failed at #340') + call g:assert.equals(&l:indentexpr, '', 'failed at #340') %delete - " #333 + " #341 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #333') - call g:assert.equals(getline(2), ' [', 'failed at #333') - call g:assert.equals(getline(3), ' foo', 'failed at #333') - call g:assert.equals(getline(4), ' ]', 'failed at #333') - call g:assert.equals(getline(5), ' }', 'failed at #333') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #333') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #333') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #333') - call g:assert.equals(&l:autoindent, 1, 'failed at #333') - call g:assert.equals(&l:smartindent, 1, 'failed at #333') - call g:assert.equals(&l:cindent, 1, 'failed at #333') - call g:assert.equals(&l:indentexpr, '', 'failed at #333') + call g:assert.equals(getline(1), ' {', 'failed at #341') + call g:assert.equals(getline(2), ' [', 'failed at #341') + call g:assert.equals(getline(3), ' foo', 'failed at #341') + call g:assert.equals(getline(4), ' ]', 'failed at #341') + call g:assert.equals(getline(5), ' }', 'failed at #341') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #341') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #341') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #341') + call g:assert.equals(&l:autoindent, 1, 'failed at #341') + call g:assert.equals(&l:smartindent, 1, 'failed at #341') + call g:assert.equals(&l:cindent, 1, 'failed at #341') + call g:assert.equals(&l:indentexpr, '', 'failed at #341') %delete - " #334 + " #342 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #334') - call g:assert.equals(getline(2), ' [', 'failed at #334') - call g:assert.equals(getline(3), ' foo', 'failed at #334') - call g:assert.equals(getline(4), ' ]', 'failed at #334') - call g:assert.equals(getline(5), ' }', 'failed at #334') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #334') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #334') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #334') - call g:assert.equals(&l:autoindent, 1, 'failed at #334') - call g:assert.equals(&l:smartindent, 1, 'failed at #334') - call g:assert.equals(&l:cindent, 1, 'failed at #334') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #334') + call g:assert.equals(getline(1), ' {', 'failed at #342') + call g:assert.equals(getline(2), ' [', 'failed at #342') + call g:assert.equals(getline(3), ' foo', 'failed at #342') + call g:assert.equals(getline(4), ' ]', 'failed at #342') + call g:assert.equals(getline(5), ' }', 'failed at #342') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #342') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #342') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #342') + call g:assert.equals(&l:autoindent, 1, 'failed at #342') + call g:assert.equals(&l:smartindent, 1, 'failed at #342') + call g:assert.equals(&l:cindent, 1, 'failed at #342') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #342') %delete """ 2 call operator#sandwich#set('replace', 'char', 'autoindent', 2) - " #335 + " #343 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #335') - call g:assert.equals(getline(2), ' [', 'failed at #335') - call g:assert.equals(getline(3), ' foo', 'failed at #335') - call g:assert.equals(getline(4), ' ]', 'failed at #335') - call g:assert.equals(getline(5), '}', 'failed at #335') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #335') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #335') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #335') - call g:assert.equals(&l:autoindent, 0, 'failed at #335') - call g:assert.equals(&l:smartindent, 0, 'failed at #335') - call g:assert.equals(&l:cindent, 0, 'failed at #335') - call g:assert.equals(&l:indentexpr, '', 'failed at #335') + call g:assert.equals(getline(1), ' {', 'failed at #343') + call g:assert.equals(getline(2), ' [', 'failed at #343') + call g:assert.equals(getline(3), ' foo', 'failed at #343') + call g:assert.equals(getline(4), ' ]', 'failed at #343') + call g:assert.equals(getline(5), '}', 'failed at #343') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #343') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #343') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #343') + call g:assert.equals(&l:autoindent, 0, 'failed at #343') + call g:assert.equals(&l:smartindent, 0, 'failed at #343') + call g:assert.equals(&l:cindent, 0, 'failed at #343') + call g:assert.equals(&l:indentexpr, '', 'failed at #343') %delete - " #336 + " #344 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #336') - call g:assert.equals(getline(2), ' [', 'failed at #336') - call g:assert.equals(getline(3), ' foo', 'failed at #336') - call g:assert.equals(getline(4), ' ]', 'failed at #336') - call g:assert.equals(getline(5), '}', 'failed at #336') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #336') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #336') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #336') - call g:assert.equals(&l:autoindent, 1, 'failed at #336') - call g:assert.equals(&l:smartindent, 0, 'failed at #336') - call g:assert.equals(&l:cindent, 0, 'failed at #336') - call g:assert.equals(&l:indentexpr, '', 'failed at #336') + call g:assert.equals(getline(1), ' {', 'failed at #344') + call g:assert.equals(getline(2), ' [', 'failed at #344') + call g:assert.equals(getline(3), ' foo', 'failed at #344') + call g:assert.equals(getline(4), ' ]', 'failed at #344') + call g:assert.equals(getline(5), '}', 'failed at #344') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #344') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #344') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #344') + call g:assert.equals(&l:autoindent, 1, 'failed at #344') + call g:assert.equals(&l:smartindent, 0, 'failed at #344') + call g:assert.equals(&l:cindent, 0, 'failed at #344') + call g:assert.equals(&l:indentexpr, '', 'failed at #344') %delete - " #337 + " #345 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #337') - call g:assert.equals(getline(2), ' [', 'failed at #337') - call g:assert.equals(getline(3), ' foo', 'failed at #337') - call g:assert.equals(getline(4), ' ]', 'failed at #337') - call g:assert.equals(getline(5), '}', 'failed at #337') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #337') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #337') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #337') - call g:assert.equals(&l:autoindent, 1, 'failed at #337') - call g:assert.equals(&l:smartindent, 1, 'failed at #337') - call g:assert.equals(&l:cindent, 0, 'failed at #337') - call g:assert.equals(&l:indentexpr, '', 'failed at #337') + call g:assert.equals(getline(1), ' {', 'failed at #345') + call g:assert.equals(getline(2), ' [', 'failed at #345') + call g:assert.equals(getline(3), ' foo', 'failed at #345') + call g:assert.equals(getline(4), ' ]', 'failed at #345') + call g:assert.equals(getline(5), '}', 'failed at #345') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #345') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #345') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #345') + call g:assert.equals(&l:autoindent, 1, 'failed at #345') + call g:assert.equals(&l:smartindent, 1, 'failed at #345') + call g:assert.equals(&l:cindent, 0, 'failed at #345') + call g:assert.equals(&l:indentexpr, '', 'failed at #345') %delete - " #338 + " #346 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #338') - call g:assert.equals(getline(2), ' [', 'failed at #338') - call g:assert.equals(getline(3), ' foo', 'failed at #338') - call g:assert.equals(getline(4), ' ]', 'failed at #338') - call g:assert.equals(getline(5), '}', 'failed at #338') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #338') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #338') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #338') - call g:assert.equals(&l:autoindent, 1, 'failed at #338') - call g:assert.equals(&l:smartindent, 1, 'failed at #338') - call g:assert.equals(&l:cindent, 1, 'failed at #338') - call g:assert.equals(&l:indentexpr, '', 'failed at #338') + call g:assert.equals(getline(1), ' {', 'failed at #346') + call g:assert.equals(getline(2), ' [', 'failed at #346') + call g:assert.equals(getline(3), ' foo', 'failed at #346') + call g:assert.equals(getline(4), ' ]', 'failed at #346') + call g:assert.equals(getline(5), '}', 'failed at #346') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #346') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #346') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #346') + call g:assert.equals(&l:autoindent, 1, 'failed at #346') + call g:assert.equals(&l:smartindent, 1, 'failed at #346') + call g:assert.equals(&l:cindent, 1, 'failed at #346') + call g:assert.equals(&l:indentexpr, '', 'failed at #346') %delete - " #339 + " #347 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #339') - call g:assert.equals(getline(2), ' [', 'failed at #339') - call g:assert.equals(getline(3), ' foo', 'failed at #339') - call g:assert.equals(getline(4), ' ]', 'failed at #339') - call g:assert.equals(getline(5), '}', 'failed at #339') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #339') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #339') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #339') - call g:assert.equals(&l:autoindent, 1, 'failed at #339') - call g:assert.equals(&l:smartindent, 1, 'failed at #339') - call g:assert.equals(&l:cindent, 1, 'failed at #339') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #339') + call g:assert.equals(getline(1), ' {', 'failed at #347') + call g:assert.equals(getline(2), ' [', 'failed at #347') + call g:assert.equals(getline(3), ' foo', 'failed at #347') + call g:assert.equals(getline(4), ' ]', 'failed at #347') + call g:assert.equals(getline(5), '}', 'failed at #347') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #347') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #347') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #347') + call g:assert.equals(&l:autoindent, 1, 'failed at #347') + call g:assert.equals(&l:smartindent, 1, 'failed at #347') + call g:assert.equals(&l:cindent, 1, 'failed at #347') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #347') %delete """ 3 call operator#sandwich#set('replace', 'char', 'autoindent', 3) - " #340 + " #348 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), '{', 'failed at #340') - call g:assert.equals(getline(2), ' [', 'failed at #340') - call g:assert.equals(getline(3), ' foo', 'failed at #340') - call g:assert.equals(getline(4), ' ]', 'failed at #340') - call g:assert.equals(getline(5), ' }', 'failed at #340') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #340') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #340') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #340') - call g:assert.equals(&l:autoindent, 0, 'failed at #340') - call g:assert.equals(&l:smartindent, 0, 'failed at #340') - call g:assert.equals(&l:cindent, 0, 'failed at #340') - call g:assert.equals(&l:indentexpr, '', 'failed at #340') + call g:assert.equals(getline(1), '{', 'failed at #348') + call g:assert.equals(getline(2), ' [', 'failed at #348') + call g:assert.equals(getline(3), ' foo', 'failed at #348') + call g:assert.equals(getline(4), ' ]', 'failed at #348') + call g:assert.equals(getline(5), ' }', 'failed at #348') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #348') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #348') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #348') + call g:assert.equals(&l:autoindent, 0, 'failed at #348') + call g:assert.equals(&l:smartindent, 0, 'failed at #348') + call g:assert.equals(&l:cindent, 0, 'failed at #348') + call g:assert.equals(&l:indentexpr, '', 'failed at #348') %delete - " #341 + " #349 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), '{', 'failed at #341') - call g:assert.equals(getline(2), ' [', 'failed at #341') - call g:assert.equals(getline(3), ' foo', 'failed at #341') - call g:assert.equals(getline(4), ' ]', 'failed at #341') - call g:assert.equals(getline(5), ' }', 'failed at #341') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #341') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #341') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #341') - call g:assert.equals(&l:autoindent, 1, 'failed at #341') - call g:assert.equals(&l:smartindent, 0, 'failed at #341') - call g:assert.equals(&l:cindent, 0, 'failed at #341') - call g:assert.equals(&l:indentexpr, '', 'failed at #341') + call g:assert.equals(getline(1), '{', 'failed at #349') + call g:assert.equals(getline(2), ' [', 'failed at #349') + call g:assert.equals(getline(3), ' foo', 'failed at #349') + call g:assert.equals(getline(4), ' ]', 'failed at #349') + call g:assert.equals(getline(5), ' }', 'failed at #349') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #349') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #349') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #349') + call g:assert.equals(&l:autoindent, 1, 'failed at #349') + call g:assert.equals(&l:smartindent, 0, 'failed at #349') + call g:assert.equals(&l:cindent, 0, 'failed at #349') + call g:assert.equals(&l:indentexpr, '', 'failed at #349') %delete - " #342 + " #350 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), '{', 'failed at #342') - call g:assert.equals(getline(2), ' [', 'failed at #342') - call g:assert.equals(getline(3), ' foo', 'failed at #342') - call g:assert.equals(getline(4), ' ]', 'failed at #342') - call g:assert.equals(getline(5), ' }', 'failed at #342') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #342') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #342') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #342') - call g:assert.equals(&l:autoindent, 1, 'failed at #342') - call g:assert.equals(&l:smartindent, 1, 'failed at #342') - call g:assert.equals(&l:cindent, 0, 'failed at #342') - call g:assert.equals(&l:indentexpr, '', 'failed at #342') + call g:assert.equals(getline(1), '{', 'failed at #350') + call g:assert.equals(getline(2), ' [', 'failed at #350') + call g:assert.equals(getline(3), ' foo', 'failed at #350') + call g:assert.equals(getline(4), ' ]', 'failed at #350') + call g:assert.equals(getline(5), ' }', 'failed at #350') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #350') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #350') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #350') + call g:assert.equals(&l:autoindent, 1, 'failed at #350') + call g:assert.equals(&l:smartindent, 1, 'failed at #350') + call g:assert.equals(&l:cindent, 0, 'failed at #350') + call g:assert.equals(&l:indentexpr, '', 'failed at #350') %delete - " #343 + " #351 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), '{', 'failed at #343') - call g:assert.equals(getline(2), ' [', 'failed at #343') - call g:assert.equals(getline(3), ' foo', 'failed at #343') - call g:assert.equals(getline(4), ' ]', 'failed at #343') - call g:assert.equals(getline(5), ' }', 'failed at #343') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #343') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #343') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #343') - call g:assert.equals(&l:autoindent, 1, 'failed at #343') - call g:assert.equals(&l:smartindent, 1, 'failed at #343') - call g:assert.equals(&l:cindent, 1, 'failed at #343') - call g:assert.equals(&l:indentexpr, '', 'failed at #343') + call g:assert.equals(getline(1), '{', 'failed at #351') + call g:assert.equals(getline(2), ' [', 'failed at #351') + call g:assert.equals(getline(3), ' foo', 'failed at #351') + call g:assert.equals(getline(4), ' ]', 'failed at #351') + call g:assert.equals(getline(5), ' }', 'failed at #351') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #351') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #351') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #351') + call g:assert.equals(&l:autoindent, 1, 'failed at #351') + call g:assert.equals(&l:smartindent, 1, 'failed at #351') + call g:assert.equals(&l:cindent, 1, 'failed at #351') + call g:assert.equals(&l:indentexpr, '', 'failed at #351') %delete - " #344 + " #352 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), '{', 'failed at #344') - call g:assert.equals(getline(2), ' [', 'failed at #344') - call g:assert.equals(getline(3), ' foo', 'failed at #344') - call g:assert.equals(getline(4), ' ]', 'failed at #344') - call g:assert.equals(getline(5), ' }', 'failed at #344') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #344') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #344') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #344') - call g:assert.equals(&l:autoindent, 1, 'failed at #344') - call g:assert.equals(&l:smartindent, 1, 'failed at #344') - call g:assert.equals(&l:cindent, 1, 'failed at #344') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #344') + call g:assert.equals(getline(1), '{', 'failed at #352') + call g:assert.equals(getline(2), ' [', 'failed at #352') + call g:assert.equals(getline(3), ' foo', 'failed at #352') + call g:assert.equals(getline(4), ' ]', 'failed at #352') + call g:assert.equals(getline(5), ' }', 'failed at #352') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #352') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #352') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #352') + call g:assert.equals(&l:autoindent, 1, 'failed at #352') + call g:assert.equals(&l:smartindent, 1, 'failed at #352') + call g:assert.equals(&l:cindent, 1, 'failed at #352') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #352') endfunction "}}} function! s:suite.charwise_x_option_indentkeys() abort "{{{ @@ -4016,7 +4060,7 @@ function! s:suite.charwise_x_option_indentkeys() abort "{{{ """ cinkeys call operator#sandwich#set('replace', 'char', 'autoindent', 3) - " #345 + " #353 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -4024,20 +4068,20 @@ function! s:suite.charwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys', '0{,0},0),:,0#,!^F,e') call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), '{', 'failed at #345') - call g:assert.equals(getline(2), 'foo', 'failed at #345') - call g:assert.equals(getline(3), ' }', 'failed at #345') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #345') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #345') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #345') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #345') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #345') + call g:assert.equals(getline(1), '{', 'failed at #353') + call g:assert.equals(getline(2), 'foo', 'failed at #353') + call g:assert.equals(getline(3), ' }', 'failed at #353') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #353') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #353') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #353') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #353') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #353') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'char', 'autoindent', 3) - " #346 + " #354 setlocal cinkeys=0{,0},0),:,0#,!^F,e setlocal indentkeys& let cinkeys = &l:cinkeys @@ -4045,20 +4089,20 @@ function! s:suite.charwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys+', 'O,o') call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), '{', 'failed at #346') - call g:assert.equals(getline(2), ' foo', 'failed at #346') - call g:assert.equals(getline(3), ' }', 'failed at #346') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #346') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #346') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #346') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #346') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #346') + call g:assert.equals(getline(1), '{', 'failed at #354') + call g:assert.equals(getline(2), ' foo', 'failed at #354') + call g:assert.equals(getline(3), ' }', 'failed at #354') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #354') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #354') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #354') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #354') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #354') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'char', 'autoindent', 3) - " #347 + " #355 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -4066,14 +4110,14 @@ function! s:suite.charwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys-', 'O,o') call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), '{', 'failed at #347') - call g:assert.equals(getline(2), 'foo', 'failed at #347') - call g:assert.equals(getline(3), ' }', 'failed at #347') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #347') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #347') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #347') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #347') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #347') + call g:assert.equals(getline(1), '{', 'failed at #355') + call g:assert.equals(getline(2), 'foo', 'failed at #355') + call g:assert.equals(getline(3), ' }', 'failed at #355') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #355') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #355') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #355') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #355') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #355') %delete call operator#sandwich#set_default() @@ -4082,7 +4126,7 @@ function! s:suite.charwise_x_option_indentkeys() abort "{{{ setlocal indentexpr=TestIndent() call operator#sandwich#set('replace', 'char', 'autoindent', -1) - " #348 + " #356 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -4090,20 +4134,20 @@ function! s:suite.charwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys', '0{,0},0),:,0#,!^F,e') call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #348') - call g:assert.equals(getline(2), 'foo', 'failed at #348') - call g:assert.equals(getline(3), ' }', 'failed at #348') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #348') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #348') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #348') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #348') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #348') + call g:assert.equals(getline(1), ' {', 'failed at #356') + call g:assert.equals(getline(2), 'foo', 'failed at #356') + call g:assert.equals(getline(3), ' }', 'failed at #356') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #356') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #356') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #356') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #356') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #356') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'char', 'autoindent', -1) - " #349 + " #357 setlocal cinkeys& setlocal indentkeys=0{,0},0),:,0#,!^F,e let cinkeys = &l:cinkeys @@ -4111,20 +4155,20 @@ function! s:suite.charwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys+', 'O,o') call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #349') - call g:assert.equals(getline(2), ' foo', 'failed at #349') - call g:assert.equals(getline(3), ' }', 'failed at #349') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #349') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #349') - " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #349') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #349') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #349') + call g:assert.equals(getline(1), ' {', 'failed at #357') + call g:assert.equals(getline(2), ' foo', 'failed at #357') + call g:assert.equals(getline(3), ' }', 'failed at #357') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #357') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #357') + " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #357') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #357') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #357') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'char', 'autoindent', -1) - " #350 + " #358 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -4132,14 +4176,14 @@ function! s:suite.charwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'char', 'indentkeys-', 'O,o') call setline('.', ' "foo"') normal ^v2i"sra - call g:assert.equals(getline(1), ' {', 'failed at #350') - call g:assert.equals(getline(2), 'foo', 'failed at #350') - call g:assert.equals(getline(3), ' }', 'failed at #350') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #350') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #350') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #350') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #350') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #350') + call g:assert.equals(getline(1), ' {', 'failed at #358') + call g:assert.equals(getline(2), 'foo', 'failed at #358') + call g:assert.equals(getline(3), ' }', 'failed at #358') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #358') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #358') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #358') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #358') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #358') endfunction "}}} @@ -4147,226 +4191,226 @@ endfunction function! s:suite.linewise_n_default_recipes() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - " #351 + " #359 call setline('.', '(foo)') normal srVl[ - call g:assert.equals(getline('.'), '[foo]', 'failed at #351') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #351') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #351') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #351') - - " #352 - call setline('.', '[foo]') - normal srVl{ - call g:assert.equals(getline('.'), '{foo}', 'failed at #352') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #352') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #352') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #352') - - " #353 - call setline('.', '{foo}') - normal srVl< - call g:assert.equals(getline('.'), '', 'failed at #353') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #353') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #353') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #353') - - " #354 - call setline('.', '') - normal srVl( - call g:assert.equals(getline('.'), '(foo)', 'failed at #354') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #354') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #354') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #354') - - %delete - - " #355 - call append(0, ['(', 'foo', ')']) - normal ggsr2j] - call g:assert.equals(getline(1), '[', 'failed at #355') - call g:assert.equals(getline(2), 'foo', 'failed at #355') - call g:assert.equals(getline(3), ']', 'failed at #355') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #355') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #355') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #355') - - " #356 - call append(0, ['[', 'foo', ']']) - normal ggsr2j} - call g:assert.equals(getline(1), '{', 'failed at #356') - call g:assert.equals(getline(2), 'foo', 'failed at #356') - call g:assert.equals(getline(3), '}', 'failed at #356') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #356') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #356') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #356') - - " #357 - call append(0, ['{', 'foo', '}']) - normal ggsr2j> - call g:assert.equals(getline(1), '<', 'failed at #357') - call g:assert.equals(getline(2), 'foo', 'failed at #357') - call g:assert.equals(getline(3), '>', 'failed at #357') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #357') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #357') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #357') - - " #358 - call append(0, ['<', 'foo', '>']) - normal ggsr2j) - call g:assert.equals(getline(1), '(', 'failed at #358') - call g:assert.equals(getline(2), 'foo', 'failed at #358') - call g:assert.equals(getline(3), ')', 'failed at #358') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #358') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #358') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #358') -endfunction -"}}} -function! s:suite.linewise_n_not_registered() abort "{{{ - call operator#sandwich#set('replace', 'line', 'linewise', 1) - - " #359 - call setline('.', 'afooa') - normal srVlb - call g:assert.equals(getline('.'), 'bfoob', 'failed at #359') + call g:assert.equals(getline('.'), '[foo]', 'failed at #359') call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #359') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #359') call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #359') " #360 - call setline('.', '+foo+') - normal srVl* - call g:assert.equals(getline('.'), '*foo*', 'failed at #360') + call setline('.', '[foo]') + normal srVl{ + call g:assert.equals(getline('.'), '{foo}', 'failed at #360') call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #360') call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #360') call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #360') + " #361 + call setline('.', '{foo}') + normal srVl< + call g:assert.equals(getline('.'), '', 'failed at #361') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #361') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #361') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #361') + + " #362 + call setline('.', '') + normal srVl( + call g:assert.equals(getline('.'), '(foo)', 'failed at #362') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #362') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #362') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #362') + %delete - " #359 + " #363 + call append(0, ['(', 'foo', ')']) + normal ggsr2j] + call g:assert.equals(getline(1), '[', 'failed at #363') + call g:assert.equals(getline(2), 'foo', 'failed at #363') + call g:assert.equals(getline(3), ']', 'failed at #363') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #363') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #363') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #363') + + " #364 + call append(0, ['[', 'foo', ']']) + normal ggsr2j} + call g:assert.equals(getline(1), '{', 'failed at #364') + call g:assert.equals(getline(2), 'foo', 'failed at #364') + call g:assert.equals(getline(3), '}', 'failed at #364') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #364') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #364') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #364') + + " #365 + call append(0, ['{', 'foo', '}']) + normal ggsr2j> + call g:assert.equals(getline(1), '<', 'failed at #365') + call g:assert.equals(getline(2), 'foo', 'failed at #365') + call g:assert.equals(getline(3), '>', 'failed at #365') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #365') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #365') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #365') + + " #366 + call append(0, ['<', 'foo', '>']) + normal ggsr2j) + call g:assert.equals(getline(1), '(', 'failed at #366') + call g:assert.equals(getline(2), 'foo', 'failed at #366') + call g:assert.equals(getline(3), ')', 'failed at #366') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #366') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #366') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #366') +endfunction +"}}} +function! s:suite.linewise_n_not_registered() abort "{{{ + call operator#sandwich#set('replace', 'line', 'linewise', 1) + + " #367 + call setline('.', 'afooa') + normal srVlb + call g:assert.equals(getline('.'), 'bfoob', 'failed at #367') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #367') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #367') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #367') + + " #368 + call setline('.', '+foo+') + normal srVl* + call g:assert.equals(getline('.'), '*foo*', 'failed at #368') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #368') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #368') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #368') + + %delete + + " #367 call append(0, ['a', 'foo', 'a']) normal ggsr2jb - call g:assert.equals(getline(1), 'b', 'failed at #359') - call g:assert.equals(getline(2), 'foo', 'failed at #359') - call g:assert.equals(getline(3), 'b', 'failed at #359') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #359') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #359') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #359') + call g:assert.equals(getline(1), 'b', 'failed at #367') + call g:assert.equals(getline(2), 'foo', 'failed at #367') + call g:assert.equals(getline(3), 'b', 'failed at #367') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #367') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #367') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #367') %delete - " #360 + " #368 call append(0, ['+', 'foo', '+']) normal ggsr2j* - call g:assert.equals(getline(1), '*', 'failed at #360') - call g:assert.equals(getline(2), 'foo', 'failed at #360') - call g:assert.equals(getline(3), '*', 'failed at #360') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #360') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #360') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #360') + call g:assert.equals(getline(1), '*', 'failed at #368') + call g:assert.equals(getline(2), 'foo', 'failed at #368') + call g:assert.equals(getline(3), '*', 'failed at #368') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #368') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #368') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #368') endfunction "}}} function! s:suite.linewise_n_positioning() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - " #361 + " #369 call append(0, ['(', 'foo', 'bar', 'baz', ')']) normal ggsrVa([ - call g:assert.equals(getline(1), '[', 'failed at #361') - call g:assert.equals(getline(2), 'foo', 'failed at #361') - call g:assert.equals(getline(3), 'bar', 'failed at #361') - call g:assert.equals(getline(4), 'baz', 'failed at #361') - call g:assert.equals(getline(5), ']', 'failed at #361') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #361') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #361') - call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #361') + call g:assert.equals(getline(1), '[', 'failed at #369') + call g:assert.equals(getline(2), 'foo', 'failed at #369') + call g:assert.equals(getline(3), 'bar', 'failed at #369') + call g:assert.equals(getline(4), 'baz', 'failed at #369') + call g:assert.equals(getline(5), ']', 'failed at #369') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #369') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #369') + call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #369') %delete - " #362 + " #370 call append(0, ['foo', '(', 'bar', ')', 'baz']) normal gg2jsrVa([ - call g:assert.equals(getline(1), 'foo', 'failed at #362') - call g:assert.equals(getline(2), '[', 'failed at #362') - call g:assert.equals(getline(3), 'bar', 'failed at #362') - call g:assert.equals(getline(4), ']', 'failed at #362') - call g:assert.equals(getline(5), 'baz', 'failed at #362') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #362') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #362') - call g:assert.equals(getpos("']"), [0, 4, 2, 0], 'failed at #362') + call g:assert.equals(getline(1), 'foo', 'failed at #370') + call g:assert.equals(getline(2), '[', 'failed at #370') + call g:assert.equals(getline(3), 'bar', 'failed at #370') + call g:assert.equals(getline(4), ']', 'failed at #370') + call g:assert.equals(getline(5), 'baz', 'failed at #370') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #370') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #370') + call g:assert.equals(getpos("']"), [0, 4, 2, 0], 'failed at #370') %delete - " #363 + " #371 call append(0, ['(foo', 'bar', 'baz)']) normal ggsrVa([ - call g:assert.equals(getline(1), '[foo', 'failed at #363') - call g:assert.equals(getline(2), 'bar', 'failed at #363') - call g:assert.equals(getline(3), 'baz]', 'failed at #363') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #363') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #363') - call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #363') + call g:assert.equals(getline(1), '[foo', 'failed at #371') + call g:assert.equals(getline(2), 'bar', 'failed at #371') + call g:assert.equals(getline(3), 'baz]', 'failed at #371') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #371') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #371') + call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #371') endfunction "}}} function! s:suite.linewise_n_nothing_inside() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - " #364 + " #372 call setline('.', '()') normal srVa([ - call g:assert.equals(getline('.'), '[]', 'failed at #364') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #364') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #364') - call g:assert.equals(getpos("']"), [0, 1, 3, 0], 'failed at #364') + call g:assert.equals(getline('.'), '[]', 'failed at #372') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #372') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #372') + call g:assert.equals(getpos("']"), [0, 1, 3, 0], 'failed at #372') %delete - " #365 + " #373 call append(0, ['(', ')']) normal ggsrVa([ - call g:assert.equals(getline(1), '[', 'failed at #365') - call g:assert.equals(getline(2), ']', 'failed at #365') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #365') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #365') - call g:assert.equals(getpos("']"), [0, 2, 2, 0], 'failed at #365') + call g:assert.equals(getline(1), '[', 'failed at #373') + call g:assert.equals(getline(2), ']', 'failed at #373') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #373') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #373') + call g:assert.equals(getpos("']"), [0, 2, 2, 0], 'failed at #373') endfunction "}}} function! s:suite.linewise_n_count() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - " #366 + " #374 call setline('.', '([foo])') normal 2srVl[( - call g:assert.equals(getline('.'), '[(foo)]', 'failed at #366') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #366') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #366') - call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #366') + call g:assert.equals(getline('.'), '[(foo)]', 'failed at #374') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #374') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #374') + call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #374') - " #367 + " #375 call setline('.', '[({foo})]') normal 3srVl{[( - call g:assert.equals(getline('.'), '{[(foo)]}', 'failed at #367') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #367') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #367') - call g:assert.equals(getpos("']"), [0, 1, 10, 0], 'failed at #367') + call g:assert.equals(getline('.'), '{[(foo)]}', 'failed at #375') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #375') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #375') + call g:assert.equals(getpos("']"), [0, 1, 10, 0], 'failed at #375') %delete - " #368 + " #376 call append(0, ['foo', '{', '[', '(', 'bar', ')', ']', '}', 'baz']) normal ggj3sr6j({[ - call g:assert.equals(getline(1), 'foo', 'failed at #368') - call g:assert.equals(getline(2), '(', 'failed at #368') - call g:assert.equals(getline(3), '{', 'failed at #368') - call g:assert.equals(getline(4), '[', 'failed at #368') - call g:assert.equals(getline(5), 'bar', 'failed at #368') - call g:assert.equals(getline(6), ']', 'failed at #368') - call g:assert.equals(getline(7), '}', 'failed at #368') - call g:assert.equals(getline(8), ')', 'failed at #368') - call g:assert.equals(getline(9), 'baz', 'failed at #368') - call g:assert.equals(getpos('.'), [0, 5, 1, 0], 'failed at #368') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #368') - call g:assert.equals(getpos("']"), [0, 8, 2, 0], 'failed at #368') + call g:assert.equals(getline(1), 'foo', 'failed at #376') + call g:assert.equals(getline(2), '(', 'failed at #376') + call g:assert.equals(getline(3), '{', 'failed at #376') + call g:assert.equals(getline(4), '[', 'failed at #376') + call g:assert.equals(getline(5), 'bar', 'failed at #376') + call g:assert.equals(getline(6), ']', 'failed at #376') + call g:assert.equals(getline(7), '}', 'failed at #376') + call g:assert.equals(getline(8), ')', 'failed at #376') + call g:assert.equals(getline(9), 'baz', 'failed at #376') + call g:assert.equals(getpos('.'), [0, 5, 1, 0], 'failed at #376') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #376') + call g:assert.equals(getpos("']"), [0, 8, 2, 0], 'failed at #376') endfunction "}}} function! s:suite.linewise_n_breaking() abort "{{{ @@ -4377,77 +4421,77 @@ function! s:suite.linewise_n_breaking() abort "{{{ \ {'buns': ["bb\nbbb\nbb", "bb\nbbb\nbb"], 'input':['b']}, \ ] - " #369 + " #377 call append(0, ['aa', 'aaafooaaa', 'aa']) normal ggsr2j( - call g:assert.equals(getline(1), '(foo)', 'failed at #369') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #369') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #369') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #369') + call g:assert.equals(getline(1), '(foo)', 'failed at #377') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #377') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #377') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #377') %delete - " #370 + " #378 call append(0, ['bb', 'bbb', 'bbfoobb', 'bbb', 'bb']) normal ggsr4j( - call g:assert.equals(getline(1), '(foo)', 'failed at #370') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #370') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #370') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #370') + call g:assert.equals(getline(1), '(foo)', 'failed at #378') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #378') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #378') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #378') %delete - " #371 + " #379 call setline('.', '(foo)') normal srVla - call g:assert.equals(getline(1), 'aa', 'failed at #371') - call g:assert.equals(getline(2), 'aaafooaaa', 'failed at #371') - call g:assert.equals(getline(3), 'aa', 'failed at #371') - call g:assert.equals(getpos('.'), [0, 2, 4, 0], 'failed at #371') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #371') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #371') + call g:assert.equals(getline(1), 'aa', 'failed at #379') + call g:assert.equals(getline(2), 'aaafooaaa', 'failed at #379') + call g:assert.equals(getline(3), 'aa', 'failed at #379') + call g:assert.equals(getpos('.'), [0, 2, 4, 0], 'failed at #379') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #379') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #379') %delete - " #372 + " #380 call setline('.', '(foo)') normal srVlb - call g:assert.equals(getline(1), 'bb', 'failed at #372') - call g:assert.equals(getline(2), 'bbb', 'failed at #372') - call g:assert.equals(getline(3), 'bbfoobb', 'failed at #372') - call g:assert.equals(getline(4), 'bbb', 'failed at #372') - call g:assert.equals(getline(5), 'bb', 'failed at #372') - call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #372') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #372') - call g:assert.equals(getpos("']"), [0, 5, 3, 0], 'failed at #372') + call g:assert.equals(getline(1), 'bb', 'failed at #380') + call g:assert.equals(getline(2), 'bbb', 'failed at #380') + call g:assert.equals(getline(3), 'bbfoobb', 'failed at #380') + call g:assert.equals(getline(4), 'bbb', 'failed at #380') + call g:assert.equals(getline(5), 'bb', 'failed at #380') + call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #380') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #380') + call g:assert.equals(getpos("']"), [0, 5, 3, 0], 'failed at #380') %delete - " #373 + " #381 call append(0, ['aa', 'aaa', 'aa', 'aaa', 'foo', 'aaa', 'aa', 'aaa', 'aa']) normal gg2sr8j(( - call g:assert.equals(getline(1), '(', 'failed at #373') - call g:assert.equals(getline(2), '(', 'failed at #373') - call g:assert.equals(getline(3), 'foo', 'failed at #373') - call g:assert.equals(getline(4), ')', 'failed at #373') - call g:assert.equals(getline(5), ')', 'failed at #373') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #373') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #373') - call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #373') + call g:assert.equals(getline(1), '(', 'failed at #381') + call g:assert.equals(getline(2), '(', 'failed at #381') + call g:assert.equals(getline(3), 'foo', 'failed at #381') + call g:assert.equals(getline(4), ')', 'failed at #381') + call g:assert.equals(getline(5), ')', 'failed at #381') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #381') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #381') + call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #381') %delete - " #374 + " #382 call append(0, ['bb', 'bbb', 'bb', 'bb', 'bbb', 'bb', 'foo', 'bb', 'bbb', 'bb', 'bb', 'bbb', 'bb']) normal gg2sr12j(( - call g:assert.equals(getline(1), '(', 'failed at #374') - call g:assert.equals(getline(2), '(', 'failed at #374') - call g:assert.equals(getline(3), 'foo', 'failed at #374') - call g:assert.equals(getline(4), ')', 'failed at #374') - call g:assert.equals(getline(5), ')', 'failed at #374') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #374') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #374') - call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #374') + call g:assert.equals(getline(1), '(', 'failed at #382') + call g:assert.equals(getline(2), '(', 'failed at #382') + call g:assert.equals(getline(3), 'foo', 'failed at #382') + call g:assert.equals(getline(4), ')', 'failed at #382') + call g:assert.equals(getline(5), ')', 'failed at #382') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #382') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #382') + call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #382') unlet! g:operator#sandwich#recipes endfunction @@ -4463,25 +4507,25 @@ function! s:suite.linewise_n_external_textobj() abort"{{{ \ {'external': ['it', 'at']}, \ ] - " #375 + " #383 call setline('.', '(foo)') normal srVl" - call g:assert.equals(getline('.'), '"foo"', 'failed at #375') + call g:assert.equals(getline('.'), '"foo"', 'failed at #383') - " #376 + " #384 call setline('.', '[foo]') normal srVl" - call g:assert.equals(getline('.'), '"foo"', 'failed at #376') + call g:assert.equals(getline('.'), '"foo"', 'failed at #384') - " #377 + " #385 call setline('.', '{foo}') normal srVl" - call g:assert.equals(getline('.'), '"foo"', 'failed at #377') + call g:assert.equals(getline('.'), '"foo"', 'failed at #385') - " #378 + " #386 call setline('.', 'foo') normal srVl" - call g:assert.equals(getline('.'), '"foo"', 'failed at #378') + call g:assert.equals(getline('.'), '"foo"', 'failed at #386') unlet g:sandwich#recipes unlet g:operator#sandwich#recipes @@ -4492,68 +4536,68 @@ function! s:suite.linewise_n_option_cursor() abort "{{{ """"" cursor """ inner_head - " #379 + " #387 call setline('.', '(((foo)))') normal 02srVl[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #379') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #379') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #387') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #387') - " #380 + " #388 normal srVl( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #380') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #380') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #388') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #388') """ keep - " #381 + " #389 call operator#sandwich#set('replace', 'line', 'cursor', 'keep') call setline('.', '(((foo)))') normal 04l2srVl[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #381') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #381') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #389') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #389') - " #382 + " #390 normal lsrVl( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #382') - call g:assert.equals(getpos('.'), [0, 1, 6, 0], 'failed at #382') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #390') + call g:assert.equals(getpos('.'), [0, 1, 6, 0], 'failed at #390') """ inner_tail - " #383 + " #391 call operator#sandwich#set('replace', 'line', 'cursor', 'inner_tail') call setline('.', '(((foo)))') normal 04l2srVl[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #383') - call g:assert.equals(getpos('.'), [0, 1, 7, 0], 'failed at #383') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #391') + call g:assert.equals(getpos('.'), [0, 1, 7, 0], 'failed at #391') - " #384 + " #392 normal hsrVl( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #384') - call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #384') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #392') + call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #392') """ head - " #385 + " #393 call operator#sandwich#set('replace', 'line', 'cursor', 'head') call setline('.', '(((foo)))') normal 04l2srVl[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #385') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #385') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #393') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #393') - " #386 + " #394 normal 3lsrVl( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #386') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #386') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #394') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #394') """ tail - " #387 + " #395 call operator#sandwich#set('replace', 'line', 'cursor', 'tail') call setline('.', '(((foo)))') normal 04l2srVl[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #387') - call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #387') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #395') + call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #395') - " #388 + " #396 normal 3hsrVl( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #388') - call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #388') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #396') + call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #396') call operator#sandwich#set('replace', 'line', 'cursor', 'inner_head') endfunction @@ -4568,27 +4612,27 @@ function! s:suite.linewise_n_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #389 + " #397 call setline('.', '{foo}') normal 0srVl" - call g:assert.equals(getline('.'), '"foo"', 'failed at #389') + call g:assert.equals(getline('.'), '"foo"', 'failed at #397') - " #390 + " #398 call setline('.', '(foo)') normal 0srVl" - call g:assert.equals(getline('.'), '(foo)', 'failed at #390') + call g:assert.equals(getline('.'), '(foo)', 'failed at #398') """ off - " #391 + " #399 call operator#sandwich#set('replace', 'line', 'noremap', 0) call setline('.', '{foo}') normal 0srVl" - call g:assert.equals(getline('.'), '{foo}', 'failed at #391') + call g:assert.equals(getline('.'), '{foo}', 'failed at #399') - " #392 + " #400 call setline('.', '(foo)') normal 0srVl" - call g:assert.equals(getline('.'), '"foo"', 'failed at #392') + call g:assert.equals(getline('.'), '"foo"', 'failed at #400') unlet! g:sandwich#recipes unlet! g:operator#sandwich#recipes @@ -4604,27 +4648,27 @@ function! s:suite.linewise_n_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #393 + " #401 call setline('.', '\d\+foo\d\+') normal 0srVl" - call g:assert.equals(getline('.'), '"foo"', 'failed at #393') + call g:assert.equals(getline('.'), '"foo"', 'failed at #401') - " #394 + " #402 call setline('.', '888foo888') normal 0srVl" - call g:assert.equals(getline('.'), '"88foo88"', 'failed at #394') + call g:assert.equals(getline('.'), '"88foo88"', 'failed at #402') """ on call operator#sandwich#set('replace', 'line', 'regex', 1) - " #395 + " #403 call setline('.', '\d\+foo\d\+') normal 0srVl" - call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #395') + call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #403') - " #396 + " #404 call setline('.', '888foo888') normal 0srVl" - call g:assert.equals(getline('.'), '"foo"', 'failed at #396') + call g:assert.equals(getline('.'), '"foo"', 'failed at #404') call operator#sandwich#set('replace', 'line', 'regex', 0) unlet! g:sandwich#recipes @@ -4634,50 +4678,72 @@ endfunction function! s:suite.linewise_n_option_skip_space() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - """ on - " #397 + """ 2 + " #405 call setline('.', '"foo"') normal 0srVl( - call g:assert.equals(getline('.'), '(foo)', 'failed at #397') + call g:assert.equals(getline('.'), '(foo)', 'failed at #405') - " #398 + " #406 call setline('.', ' "foo"') normal 0srVl( - call g:assert.equals(getline('.'), ' (foo)', 'failed at #398') + call g:assert.equals(getline('.'), ' (foo)', 'failed at #406') - " #399 + " #407 call setline('.', '"foo" ') normal 0srVl( - call g:assert.equals(getline('.'), '(foo) ', 'failed at #399') + call g:assert.equals(getline('.'), '(foo) ', 'failed at #407') - " #400 + " #408 + call setline('.', ' "foo" ') + normal 0srVl( + call g:assert.equals(getline('.'), ' (foo) ', 'failed at #408') + + """ 1 + call operator#sandwich#set('replace', 'line', 'skip_space', 1) + " #409 + call setline('.', '"foo"') + normal 0srVl( + call g:assert.equals(getline('.'), '(foo)', 'failed at #409') + + " #410 + call setline('.', ' "foo"') + normal 0srVl( + call g:assert.equals(getline('.'), ' (foo)', 'failed at #410') + + " #411 + call setline('.', '"foo" ') + normal 0srVl( + call g:assert.equals(getline('.'), '(foo) ', 'failed at #411') + + " #412 " do not skip! call setline('.', ' "foo" ') normal 0srVl( - call g:assert.equals(getline('.'), '("foo")', 'failed at #400') + call g:assert.equals(getline('.'), '("foo")', 'failed at #412') - """ off + """ 0 call operator#sandwich#set('replace', 'line', 'skip_space', 0) - " #401 + " #413 call setline('.', '"foo"') normal 0srVl( - call g:assert.equals(getline('.'), '(foo)', 'failed at #401') + call g:assert.equals(getline('.'), '(foo)', 'failed at #413') - " #402 + " #414 call setline('.', ' "foo"') normal 0srVl( - call g:assert.equals(getline('.'), ' "foo"', 'failed at #402') + call g:assert.equals(getline('.'), ' "foo"', 'failed at #414') - " #403 + " #415 call setline('.', '"foo" ') normal 0srVl( - call g:assert.equals(getline('.'), '"foo" ', 'failed at #403') + call g:assert.equals(getline('.'), '"foo" ', 'failed at #415') - " #404 + " #416 " do not skip! call setline('.', ' "foo" ') normal 0srVl( - call g:assert.equals(getline('.'), '("foo")', 'failed at #404') + call g:assert.equals(getline('.'), '("foo")', 'failed at #416') call operator#sandwich#set('replace', 'line', 'skip_space', 1) endfunction @@ -4686,17 +4752,17 @@ function! s:suite.linewise_n_option_skip_char() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) """ off - " #405 + " #417 call setline('.', 'aa(foo)bb') normal 0srVl" - call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #405') + call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #417') """ on call operator#sandwich#set('replace', 'line', 'skip_char', 1) - " #406 + " #418 call setline('.', 'aa(foo)bb') normal 0srVl" - call g:assert.equals(getline('.'), 'aa"foo"bb', 'failed at #406') + call g:assert.equals(getline('.'), 'aa"foo"bb', 'failed at #418') call operator#sandwich#set('replace', 'line', 'skip_char', 0) endfunction @@ -4706,10 +4772,10 @@ function! s:suite.linewise_n_option_command() abort "{{{ call operator#sandwich#set('replace', 'line', 'command', ['normal! `[dv`]']) - " #407 + " #419 call setline('.', '(foo)') normal 0srVl" - call g:assert.equals(getline('.'), '""', 'failed at #407') + call g:assert.equals(getline('.'), '""', 'failed at #419') call operator#sandwich#set('replace', 'line', 'command', []) endfunction @@ -4720,116 +4786,116 @@ function! s:suite.linewise_n_option_linewise() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 0) """ 0 - " #408 + " #420 call append(0, ['(', 'foo', ')']) normal ggsr2j[ - call g:assert.equals(getline(1), '[', 'failed at #408') - call g:assert.equals(getline(2), 'foo', 'failed at #408') - call g:assert.equals(getline(3), ']', 'failed at #408') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #408') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #408') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #408') + call g:assert.equals(getline(1), '[', 'failed at #420') + call g:assert.equals(getline(2), 'foo', 'failed at #420') + call g:assert.equals(getline(3), ']', 'failed at #420') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #420') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #420') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #420') %delete - " #409 + " #421 call append(0, ['( ', 'foo', ' )']) normal ggsr2j[ - call g:assert.equals(getline(1), '[ ', 'failed at #409') - call g:assert.equals(getline(2), 'foo', 'failed at #409') - call g:assert.equals(getline(3), ' ]', 'failed at #409') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #409') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #409') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #409') + call g:assert.equals(getline(1), '[ ', 'failed at #421') + call g:assert.equals(getline(2), 'foo', 'failed at #421') + call g:assert.equals(getline(3), ' ]', 'failed at #421') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #421') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #421') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #421') %delete - " #410 + " #422 call append(0, ['(aa', 'foo', 'aa)']) normal ggsr2j[ - call g:assert.equals(getline(1), '[aa', 'failed at #410') - call g:assert.equals(getline(2), 'foo', 'failed at #410') - call g:assert.equals(getline(3), 'aa]', 'failed at #410') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #410') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #410') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #410') + call g:assert.equals(getline(1), '[aa', 'failed at #422') + call g:assert.equals(getline(2), 'foo', 'failed at #422') + call g:assert.equals(getline(3), 'aa]', 'failed at #422') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #422') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #422') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #422') %delete - " #411 + " #423 call append(0, ['(aa', 'foo', ')']) normal ggsr2j[ - call g:assert.equals(getline(1), '[aa', 'failed at #411') - call g:assert.equals(getline(2), 'foo', 'failed at #411') - call g:assert.equals(getline(3), ']', 'failed at #411') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #411') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #411') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #411') + call g:assert.equals(getline(1), '[aa', 'failed at #423') + call g:assert.equals(getline(2), 'foo', 'failed at #423') + call g:assert.equals(getline(3), ']', 'failed at #423') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #423') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #423') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #423') %delete - " #412 + " #424 call append(0, ['(', 'foo', 'aa)']) normal ggsr2j[ - call g:assert.equals(getline(1), '[', 'failed at #412') - call g:assert.equals(getline(2), 'foo', 'failed at #412') - call g:assert.equals(getline(3), 'aa]', 'failed at #412') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #412') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #412') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #412') + call g:assert.equals(getline(1), '[', 'failed at #424') + call g:assert.equals(getline(2), 'foo', 'failed at #424') + call g:assert.equals(getline(3), 'aa]', 'failed at #424') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #424') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #424') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #424') %delete call operator#sandwich#set('replace', 'line', 'linewise', 2) """ 2 - " #413 + " #425 call append(0, ['(', 'foo', ')']) normal ggsr2j[ - call g:assert.equals(getline(1), '[', 'failed at #413') - call g:assert.equals(getline(2), 'foo', 'failed at #413') - call g:assert.equals(getline(3), ']', 'failed at #413') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #413') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #413') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #413') + call g:assert.equals(getline(1), '[', 'failed at #425') + call g:assert.equals(getline(2), 'foo', 'failed at #425') + call g:assert.equals(getline(3), ']', 'failed at #425') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #425') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #425') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #425') %delete - " #414 + " #426 call append(0, ['( ', 'foo', ' )']) normal ggsr2j[ - call g:assert.equals(getline(1), '[', 'failed at #414') - call g:assert.equals(getline(2), 'foo', 'failed at #414') - call g:assert.equals(getline(3), ']', 'failed at #414') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #414') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #414') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #414') + call g:assert.equals(getline(1), '[', 'failed at #426') + call g:assert.equals(getline(2), 'foo', 'failed at #426') + call g:assert.equals(getline(3), ']', 'failed at #426') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #426') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #426') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #426') %delete - " #415 + " #427 call append(0, ['(aa', 'foo', 'aa)']) normal ggsr2j[ - call g:assert.equals(getline(1), '[', 'failed at #415') - call g:assert.equals(getline(2), 'foo', 'failed at #415') - call g:assert.equals(getline(3), ']', 'failed at #415') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #415') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #415') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #415') + call g:assert.equals(getline(1), '[', 'failed at #427') + call g:assert.equals(getline(2), 'foo', 'failed at #427') + call g:assert.equals(getline(3), ']', 'failed at #427') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #427') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #427') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #427') %delete - " #416 + " #428 " FIXME: I have no idea what is the expexted behavior. call append(0, ['aa', '(foo)', 'bb']) normal ggjsrVl[ - call g:assert.equals(getline(1), 'aa', 'failed at #416') - call g:assert.equals(getline(2), '[', 'failed at #416') - call g:assert.equals(getline(3), 'bb', 'failed at #416') - call g:assert.equals(getline(4), '', 'failed at #416') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #416') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #416') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #416') + call g:assert.equals(getline(1), 'aa', 'failed at #428') + call g:assert.equals(getline(2), '[', 'failed at #428') + call g:assert.equals(getline(3), 'bb', 'failed at #428') + call g:assert.equals(getline(4), '', 'failed at #428') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #428') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #428') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #428') endfunction "}}} function! s:suite.linewise_n_option_query_once() abort "{{{ @@ -4837,19 +4903,19 @@ function! s:suite.linewise_n_option_query_once() abort "{{{ """"" query_once """ off - " #417 + " #429 call setline('.', '"""foo"""') normal 03srVl([{ - call g:assert.equals(getline('.'), '([{foo}])', 'failed at #417') + call g:assert.equals(getline('.'), '([{foo}])', 'failed at #429') %delete """ on - " #418 + " #430 call operator#sandwich#set('replace', 'line', 'query_once', 1) call setline('.', '"""foo"""') normal 03srVl( - call g:assert.equals(getline('.'), '(((foo)))', 'failed at #418') + call g:assert.equals(getline('.'), '(((foo)))', 'failed at #430') call operator#sandwich#set('replace', 'line', 'query_once', 0) endfunction @@ -4861,17 +4927,17 @@ function! s:suite.linewise_n_option_expr() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['1+1', '1+2'], 'input':['a']}] """ 0 - " #419 + " #431 call setline('.', '"foo"') normal 0srVla - call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #419') + call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #431') """ 1 - " #420 + " #432 call operator#sandwich#set('replace', 'line', 'expr', 1) call setline('.', '"foo"') normal 0srVla - call g:assert.equals(getline('.'), '2foo3', 'failed at #420') + call g:assert.equals(getline('.'), '2foo3', 'failed at #432') """ 2 " This case cannot be tested since this option makes difference only in @@ -4896,313 +4962,34 @@ function! s:suite.linewise_n_option_autoindent() abort "{{{ """ -1 call operator#sandwich#set('replace', 'line', 'autoindent', -1) - " #421 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #421') - call g:assert.equals(getline(2), '[', 'failed at #421') - call g:assert.equals(getline(3), '', 'failed at #421') - call g:assert.equals(getline(4), ' foo', 'failed at #421') - call g:assert.equals(getline(5), '', 'failed at #421') - call g:assert.equals(getline(6), ']', 'failed at #421') - call g:assert.equals(getline(7), '}', 'failed at #421') - " call g:assert.equals(getpos('.'), [0, 4, 5, 0], 'failed at #421') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #421') - " call g:assert.equals(getpos("']"), [0, 7, 2, 0], 'failed at #421') - call g:assert.equals(&l:autoindent, 0, 'failed at #421') - call g:assert.equals(&l:smartindent, 0, 'failed at #421') - call g:assert.equals(&l:cindent, 0, 'failed at #421') - call g:assert.equals(&l:indentexpr, '', 'failed at #421') - - %delete - - " #422 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), ' {', 'failed at #422') - call g:assert.equals(getline(2), ' [', 'failed at #422') - call g:assert.equals(getline(3), '', 'failed at #422') - call g:assert.equals(getline(4), ' foo', 'failed at #422') - call g:assert.equals(getline(5), '', 'failed at #422') - call g:assert.equals(getline(6), ' ]', 'failed at #422') - call g:assert.equals(getline(7), ' }', 'failed at #422') - " call g:assert.equals(getpos('.'), [0, 4, 5, 0], 'failed at #422') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #422') - " call g:assert.equals(getpos("']"), [0, 7, 6, 0], 'failed at #422') - call g:assert.equals(&l:autoindent, 1, 'failed at #422') - call g:assert.equals(&l:smartindent, 0, 'failed at #422') - call g:assert.equals(&l:cindent, 0, 'failed at #422') - call g:assert.equals(&l:indentexpr, '', 'failed at #422') - - %delete - - " #423 - setlocal smartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #423') - call g:assert.equals(getline(2), ' [', 'failed at #423') - call g:assert.equals(getline(3), '', 'failed at #423') - call g:assert.equals(getline(4), ' foo', 'failed at #423') - call g:assert.equals(getline(5), '', 'failed at #423') - call g:assert.equals(getline(6), ' ]', 'failed at #423') - call g:assert.equals(getline(7), '}', 'failed at #423') - " call g:assert.equals(getpos('.'), [0, 4, 9, 0], 'failed at #423') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #423') - " call g:assert.equals(getpos("']"), [0, 7, 2, 0], 'failed at #423') - call g:assert.equals(&l:autoindent, 1, 'failed at #423') - call g:assert.equals(&l:smartindent, 1, 'failed at #423') - call g:assert.equals(&l:cindent, 0, 'failed at #423') - call g:assert.equals(&l:indentexpr, '', 'failed at #423') - - %delete - - " #424 - setlocal cindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #424') - call g:assert.equals(getline(2), ' [', 'failed at #424') - call g:assert.equals(getline(3), '', 'failed at #424') - call g:assert.equals(getline(4), ' foo', 'failed at #424') - call g:assert.equals(getline(5), '', 'failed at #424') - call g:assert.equals(getline(6), ' ]', 'failed at #424') - call g:assert.equals(getline(7), ' }', 'failed at #424') - " call g:assert.equals(getpos('.'), [0, 4, 9, 0], 'failed at #424') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #424') - " call g:assert.equals(getpos("']"), [0, 7, 6, 0], 'failed at #424') - call g:assert.equals(&l:autoindent, 1, 'failed at #424') - call g:assert.equals(&l:smartindent, 1, 'failed at #424') - call g:assert.equals(&l:cindent, 1, 'failed at #424') - call g:assert.equals(&l:indentexpr, '', 'failed at #424') - - %delete - - " #425 - setlocal indentexpr=TestIndent() - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), ' {', 'failed at #425') - call g:assert.equals(getline(2), ' [', 'failed at #425') - call g:assert.equals(getline(3), '', 'failed at #425') - call g:assert.equals(getline(4), ' foo', 'failed at #425') - call g:assert.equals(getline(5), '', 'failed at #425') - call g:assert.equals(getline(6), ' ]', 'failed at #425') - call g:assert.equals(getline(7), ' }', 'failed at #425') - " call g:assert.equals(getpos('.'), [0, 4, 17, 0], 'failed at #425') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #425') - " call g:assert.equals(getpos("']"), [0, 7, 18, 0], 'failed at #425') - call g:assert.equals(&l:autoindent, 1, 'failed at #425') - call g:assert.equals(&l:smartindent, 1, 'failed at #425') - call g:assert.equals(&l:cindent, 1, 'failed at #425') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #425') - - %delete - - """ 0 - call operator#sandwich#set('replace', 'line', 'autoindent', 0) - - " #426 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #426') - call g:assert.equals(getline(2), '[', 'failed at #426') - call g:assert.equals(getline(3), '', 'failed at #426') - call g:assert.equals(getline(4), ' foo', 'failed at #426') - call g:assert.equals(getline(5), '', 'failed at #426') - call g:assert.equals(getline(6), ']', 'failed at #426') - call g:assert.equals(getline(7), '}', 'failed at #426') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #426') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #426') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #426') - call g:assert.equals(&l:autoindent, 0, 'failed at #426') - call g:assert.equals(&l:smartindent, 0, 'failed at #426') - call g:assert.equals(&l:cindent, 0, 'failed at #426') - call g:assert.equals(&l:indentexpr, '', 'failed at #426') - - %delete - - " #427 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #427') - call g:assert.equals(getline(2), '[', 'failed at #427') - call g:assert.equals(getline(3), '', 'failed at #427') - call g:assert.equals(getline(4), ' foo', 'failed at #427') - call g:assert.equals(getline(5), '', 'failed at #427') - call g:assert.equals(getline(6), ']', 'failed at #427') - call g:assert.equals(getline(7), '}', 'failed at #427') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #427') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #427') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #427') - call g:assert.equals(&l:autoindent, 1, 'failed at #427') - call g:assert.equals(&l:smartindent, 0, 'failed at #427') - call g:assert.equals(&l:cindent, 0, 'failed at #427') - call g:assert.equals(&l:indentexpr, '', 'failed at #427') - - %delete - - " #428 - setlocal smartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #428') - call g:assert.equals(getline(2), '[', 'failed at #428') - call g:assert.equals(getline(3), '', 'failed at #428') - call g:assert.equals(getline(4), ' foo', 'failed at #428') - call g:assert.equals(getline(5), '', 'failed at #428') - call g:assert.equals(getline(6), ']', 'failed at #428') - call g:assert.equals(getline(7), '}', 'failed at #428') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #428') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #428') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #428') - call g:assert.equals(&l:autoindent, 1, 'failed at #428') - call g:assert.equals(&l:smartindent, 1, 'failed at #428') - call g:assert.equals(&l:cindent, 0, 'failed at #428') - call g:assert.equals(&l:indentexpr, '', 'failed at #428') - - %delete - - " #429 - setlocal cindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #429') - call g:assert.equals(getline(2), '[', 'failed at #429') - call g:assert.equals(getline(3), '', 'failed at #429') - call g:assert.equals(getline(4), ' foo', 'failed at #429') - call g:assert.equals(getline(5), '', 'failed at #429') - call g:assert.equals(getline(6), ']', 'failed at #429') - call g:assert.equals(getline(7), '}', 'failed at #429') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #429') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #429') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #429') - call g:assert.equals(&l:autoindent, 1, 'failed at #429') - call g:assert.equals(&l:smartindent, 1, 'failed at #429') - call g:assert.equals(&l:cindent, 1, 'failed at #429') - call g:assert.equals(&l:indentexpr, '', 'failed at #429') - - %delete - - " #430 - setlocal indentexpr=TestIndent() - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #430') - call g:assert.equals(getline(2), '[', 'failed at #430') - call g:assert.equals(getline(3), '', 'failed at #430') - call g:assert.equals(getline(4), ' foo', 'failed at #430') - call g:assert.equals(getline(5), '', 'failed at #430') - call g:assert.equals(getline(6), ']', 'failed at #430') - call g:assert.equals(getline(7), '}', 'failed at #430') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #430') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #430') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #430') - call g:assert.equals(&l:autoindent, 1, 'failed at #430') - call g:assert.equals(&l:smartindent, 1, 'failed at #430') - call g:assert.equals(&l:cindent, 1, 'failed at #430') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #430') - - %delete - - """ 1 - call operator#sandwich#set('replace', 'line', 'autoindent', 1) - - " #431 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), ' {', 'failed at #431') - call g:assert.equals(getline(2), ' [', 'failed at #431') - call g:assert.equals(getline(3), '', 'failed at #431') - call g:assert.equals(getline(4), ' foo', 'failed at #431') - call g:assert.equals(getline(5), '', 'failed at #431') - call g:assert.equals(getline(6), ' ]', 'failed at #431') - call g:assert.equals(getline(7), ' }', 'failed at #431') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #431') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #431') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #431') - call g:assert.equals(&l:autoindent, 0, 'failed at #431') - call g:assert.equals(&l:smartindent, 0, 'failed at #431') - call g:assert.equals(&l:cindent, 0, 'failed at #431') - call g:assert.equals(&l:indentexpr, '', 'failed at #431') - - %delete - - " #432 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), ' {', 'failed at #432') - call g:assert.equals(getline(2), ' [', 'failed at #432') - call g:assert.equals(getline(3), '', 'failed at #432') - call g:assert.equals(getline(4), ' foo', 'failed at #432') - call g:assert.equals(getline(5), '', 'failed at #432') - call g:assert.equals(getline(6), ' ]', 'failed at #432') - call g:assert.equals(getline(7), ' }', 'failed at #432') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #432') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #432') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #432') - call g:assert.equals(&l:autoindent, 1, 'failed at #432') - call g:assert.equals(&l:smartindent, 0, 'failed at #432') - call g:assert.equals(&l:cindent, 0, 'failed at #432') - call g:assert.equals(&l:indentexpr, '', 'failed at #432') - - %delete - " #433 - setlocal smartindent + setlocal noautoindent + setlocal nosmartindent setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), ' {', 'failed at #433') - call g:assert.equals(getline(2), ' [', 'failed at #433') + call g:assert.equals(getline(1), '{', 'failed at #433') + call g:assert.equals(getline(2), '[', 'failed at #433') call g:assert.equals(getline(3), '', 'failed at #433') call g:assert.equals(getline(4), ' foo', 'failed at #433') call g:assert.equals(getline(5), '', 'failed at #433') - call g:assert.equals(getline(6), ' ]', 'failed at #433') - call g:assert.equals(getline(7), ' }', 'failed at #433') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #433') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #433') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #433') - call g:assert.equals(&l:autoindent, 1, 'failed at #433') - call g:assert.equals(&l:smartindent, 1, 'failed at #433') + call g:assert.equals(getline(6), ']', 'failed at #433') + call g:assert.equals(getline(7), '}', 'failed at #433') + " call g:assert.equals(getpos('.'), [0, 4, 5, 0], 'failed at #433') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #433') + " call g:assert.equals(getpos("']"), [0, 7, 2, 0], 'failed at #433') + call g:assert.equals(&l:autoindent, 0, 'failed at #433') + call g:assert.equals(&l:smartindent, 0, 'failed at #433') call g:assert.equals(&l:cindent, 0, 'failed at #433') call g:assert.equals(&l:indentexpr, '', 'failed at #433') %delete " #434 - setlocal cindent + setlocal autoindent + setlocal nosmartindent + setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggsrV2ja @@ -5213,44 +5000,41 @@ function! s:suite.linewise_n_option_autoindent() abort "{{{ call g:assert.equals(getline(5), '', 'failed at #434') call g:assert.equals(getline(6), ' ]', 'failed at #434') call g:assert.equals(getline(7), ' }', 'failed at #434') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #434') + " call g:assert.equals(getpos('.'), [0, 4, 5, 0], 'failed at #434') " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #434') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #434') + " call g:assert.equals(getpos("']"), [0, 7, 6, 0], 'failed at #434') call g:assert.equals(&l:autoindent, 1, 'failed at #434') - call g:assert.equals(&l:smartindent, 1, 'failed at #434') - call g:assert.equals(&l:cindent, 1, 'failed at #434') + call g:assert.equals(&l:smartindent, 0, 'failed at #434') + call g:assert.equals(&l:cindent, 0, 'failed at #434') call g:assert.equals(&l:indentexpr, '', 'failed at #434') %delete " #435 - setlocal indentexpr=TestIndent() + setlocal smartindent + setlocal nocindent + setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), ' {', 'failed at #435') - call g:assert.equals(getline(2), ' [', 'failed at #435') - call g:assert.equals(getline(3), '', 'failed at #435') - call g:assert.equals(getline(4), ' foo', 'failed at #435') - call g:assert.equals(getline(5), '', 'failed at #435') - call g:assert.equals(getline(6), ' ]', 'failed at #435') - call g:assert.equals(getline(7), ' }', 'failed at #435') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #435') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #435') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #435') - call g:assert.equals(&l:autoindent, 1, 'failed at #435') - call g:assert.equals(&l:smartindent, 1, 'failed at #435') - call g:assert.equals(&l:cindent, 1, 'failed at #435') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #435') + call g:assert.equals(getline(1), '{', 'failed at #435') + call g:assert.equals(getline(2), ' [', 'failed at #435') + call g:assert.equals(getline(3), '', 'failed at #435') + call g:assert.equals(getline(4), ' foo', 'failed at #435') + call g:assert.equals(getline(5), '', 'failed at #435') + call g:assert.equals(getline(6), ' ]', 'failed at #435') + call g:assert.equals(getline(7), '}', 'failed at #435') + " call g:assert.equals(getpos('.'), [0, 4, 9, 0], 'failed at #435') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #435') + " call g:assert.equals(getpos("']"), [0, 7, 2, 0], 'failed at #435') + call g:assert.equals(&l:autoindent, 1, 'failed at #435') + call g:assert.equals(&l:smartindent, 1, 'failed at #435') + call g:assert.equals(&l:cindent, 0, 'failed at #435') + call g:assert.equals(&l:indentexpr, '', 'failed at #435') %delete - """ 2 - call operator#sandwich#set('replace', 'line', 'autoindent', 2) - " #436 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent + setlocal cindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggsrV2ja @@ -5260,221 +5044,503 @@ function! s:suite.linewise_n_option_autoindent() abort "{{{ call g:assert.equals(getline(4), ' foo', 'failed at #436') call g:assert.equals(getline(5), '', 'failed at #436') call g:assert.equals(getline(6), ' ]', 'failed at #436') - call g:assert.equals(getline(7), '}', 'failed at #436') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #436') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #436') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #436') - call g:assert.equals(&l:autoindent, 0, 'failed at #436') - call g:assert.equals(&l:smartindent, 0, 'failed at #436') - call g:assert.equals(&l:cindent, 0, 'failed at #436') + call g:assert.equals(getline(7), ' }', 'failed at #436') + " call g:assert.equals(getpos('.'), [0, 4, 9, 0], 'failed at #436') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #436') + " call g:assert.equals(getpos("']"), [0, 7, 6, 0], 'failed at #436') + call g:assert.equals(&l:autoindent, 1, 'failed at #436') + call g:assert.equals(&l:smartindent, 1, 'failed at #436') + call g:assert.equals(&l:cindent, 1, 'failed at #436') call g:assert.equals(&l:indentexpr, '', 'failed at #436') %delete " #437 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #437') - call g:assert.equals(getline(2), ' [', 'failed at #437') - call g:assert.equals(getline(3), '', 'failed at #437') - call g:assert.equals(getline(4), ' foo', 'failed at #437') - call g:assert.equals(getline(5), '', 'failed at #437') - call g:assert.equals(getline(6), ' ]', 'failed at #437') - call g:assert.equals(getline(7), '}', 'failed at #437') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #437') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #437') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #437') - call g:assert.equals(&l:autoindent, 1, 'failed at #437') - call g:assert.equals(&l:smartindent, 0, 'failed at #437') - call g:assert.equals(&l:cindent, 0, 'failed at #437') - call g:assert.equals(&l:indentexpr, '', 'failed at #437') - - %delete - - " #438 - setlocal smartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #438') - call g:assert.equals(getline(2), ' [', 'failed at #438') - call g:assert.equals(getline(3), '', 'failed at #438') - call g:assert.equals(getline(4), ' foo', 'failed at #438') - call g:assert.equals(getline(5), '', 'failed at #438') - call g:assert.equals(getline(6), ' ]', 'failed at #438') - call g:assert.equals(getline(7), '}', 'failed at #438') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #438') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #438') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #438') - call g:assert.equals(&l:autoindent, 1, 'failed at #438') - call g:assert.equals(&l:smartindent, 1, 'failed at #438') - call g:assert.equals(&l:cindent, 0, 'failed at #438') - call g:assert.equals(&l:indentexpr, '', 'failed at #438') - - %delete - - " #439 - setlocal cindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #439') - call g:assert.equals(getline(2), ' [', 'failed at #439') - call g:assert.equals(getline(3), '', 'failed at #439') - call g:assert.equals(getline(4), ' foo', 'failed at #439') - call g:assert.equals(getline(5), '', 'failed at #439') - call g:assert.equals(getline(6), ' ]', 'failed at #439') - call g:assert.equals(getline(7), '}', 'failed at #439') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #439') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #439') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #439') - call g:assert.equals(&l:autoindent, 1, 'failed at #439') - call g:assert.equals(&l:smartindent, 1, 'failed at #439') - call g:assert.equals(&l:cindent, 1, 'failed at #439') - call g:assert.equals(&l:indentexpr, '', 'failed at #439') - - %delete - - " #440 setlocal indentexpr=TestIndent() call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #440') - call g:assert.equals(getline(2), ' [', 'failed at #440') - call g:assert.equals(getline(3), '', 'failed at #440') - call g:assert.equals(getline(4), ' foo', 'failed at #440') - call g:assert.equals(getline(5), '', 'failed at #440') - call g:assert.equals(getline(6), ' ]', 'failed at #440') - call g:assert.equals(getline(7), '}', 'failed at #440') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #440') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #440') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #440') - call g:assert.equals(&l:autoindent, 1, 'failed at #440') - call g:assert.equals(&l:smartindent, 1, 'failed at #440') - call g:assert.equals(&l:cindent, 1, 'failed at #440') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #440') + call g:assert.equals(getline(1), ' {', 'failed at #437') + call g:assert.equals(getline(2), ' [', 'failed at #437') + call g:assert.equals(getline(3), '', 'failed at #437') + call g:assert.equals(getline(4), ' foo', 'failed at #437') + call g:assert.equals(getline(5), '', 'failed at #437') + call g:assert.equals(getline(6), ' ]', 'failed at #437') + call g:assert.equals(getline(7), ' }', 'failed at #437') + " call g:assert.equals(getpos('.'), [0, 4, 17, 0], 'failed at #437') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #437') + " call g:assert.equals(getpos("']"), [0, 7, 18, 0], 'failed at #437') + call g:assert.equals(&l:autoindent, 1, 'failed at #437') + call g:assert.equals(&l:smartindent, 1, 'failed at #437') + call g:assert.equals(&l:cindent, 1, 'failed at #437') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #437') %delete - """ 3 - call operator#sandwich#set('replace', 'line', 'autoindent', 3) + """ 0 + call operator#sandwich#set('replace', 'line', 'autoindent', 0) - " #441 + " #438 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #441') - call g:assert.equals(getline(2), ' [', 'failed at #441') - call g:assert.equals(getline(3), '', 'failed at #441') - call g:assert.equals(getline(4), ' foo', 'failed at #441') - call g:assert.equals(getline(5), '', 'failed at #441') - call g:assert.equals(getline(6), ' ]', 'failed at #441') - call g:assert.equals(getline(7), ' }', 'failed at #441') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #441') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #441') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #441') - call g:assert.equals(&l:autoindent, 0, 'failed at #441') - call g:assert.equals(&l:smartindent, 0, 'failed at #441') - call g:assert.equals(&l:cindent, 0, 'failed at #441') - call g:assert.equals(&l:indentexpr, '', 'failed at #441') + call g:assert.equals(getline(1), '{', 'failed at #438') + call g:assert.equals(getline(2), '[', 'failed at #438') + call g:assert.equals(getline(3), '', 'failed at #438') + call g:assert.equals(getline(4), ' foo', 'failed at #438') + call g:assert.equals(getline(5), '', 'failed at #438') + call g:assert.equals(getline(6), ']', 'failed at #438') + call g:assert.equals(getline(7), '}', 'failed at #438') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #438') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #438') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #438') + call g:assert.equals(&l:autoindent, 0, 'failed at #438') + call g:assert.equals(&l:smartindent, 0, 'failed at #438') + call g:assert.equals(&l:cindent, 0, 'failed at #438') + call g:assert.equals(&l:indentexpr, '', 'failed at #438') %delete - " #442 + " #439 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #442') - call g:assert.equals(getline(2), ' [', 'failed at #442') - call g:assert.equals(getline(3), '', 'failed at #442') - call g:assert.equals(getline(4), ' foo', 'failed at #442') - call g:assert.equals(getline(5), '', 'failed at #442') - call g:assert.equals(getline(6), ' ]', 'failed at #442') - call g:assert.equals(getline(7), ' }', 'failed at #442') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #442') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #442') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #442') - call g:assert.equals(&l:autoindent, 1, 'failed at #442') - call g:assert.equals(&l:smartindent, 0, 'failed at #442') - call g:assert.equals(&l:cindent, 0, 'failed at #442') - call g:assert.equals(&l:indentexpr, '', 'failed at #442') + call g:assert.equals(getline(1), '{', 'failed at #439') + call g:assert.equals(getline(2), '[', 'failed at #439') + call g:assert.equals(getline(3), '', 'failed at #439') + call g:assert.equals(getline(4), ' foo', 'failed at #439') + call g:assert.equals(getline(5), '', 'failed at #439') + call g:assert.equals(getline(6), ']', 'failed at #439') + call g:assert.equals(getline(7), '}', 'failed at #439') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #439') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #439') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #439') + call g:assert.equals(&l:autoindent, 1, 'failed at #439') + call g:assert.equals(&l:smartindent, 0, 'failed at #439') + call g:assert.equals(&l:cindent, 0, 'failed at #439') + call g:assert.equals(&l:indentexpr, '', 'failed at #439') %delete - " #443 + " #440 setlocal smartindent setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #443') - call g:assert.equals(getline(2), ' [', 'failed at #443') - call g:assert.equals(getline(3), '', 'failed at #443') - call g:assert.equals(getline(4), ' foo', 'failed at #443') - call g:assert.equals(getline(5), '', 'failed at #443') - call g:assert.equals(getline(6), ' ]', 'failed at #443') - call g:assert.equals(getline(7), ' }', 'failed at #443') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #443') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #443') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #443') - call g:assert.equals(&l:autoindent, 1, 'failed at #443') - call g:assert.equals(&l:smartindent, 1, 'failed at #443') - call g:assert.equals(&l:cindent, 0, 'failed at #443') - call g:assert.equals(&l:indentexpr, '', 'failed at #443') + call g:assert.equals(getline(1), '{', 'failed at #440') + call g:assert.equals(getline(2), '[', 'failed at #440') + call g:assert.equals(getline(3), '', 'failed at #440') + call g:assert.equals(getline(4), ' foo', 'failed at #440') + call g:assert.equals(getline(5), '', 'failed at #440') + call g:assert.equals(getline(6), ']', 'failed at #440') + call g:assert.equals(getline(7), '}', 'failed at #440') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #440') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #440') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #440') + call g:assert.equals(&l:autoindent, 1, 'failed at #440') + call g:assert.equals(&l:smartindent, 1, 'failed at #440') + call g:assert.equals(&l:cindent, 0, 'failed at #440') + call g:assert.equals(&l:indentexpr, '', 'failed at #440') %delete - " #444 + " #441 setlocal cindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #444') - call g:assert.equals(getline(2), ' [', 'failed at #444') - call g:assert.equals(getline(3), '', 'failed at #444') - call g:assert.equals(getline(4), ' foo', 'failed at #444') - call g:assert.equals(getline(5), '', 'failed at #444') - call g:assert.equals(getline(6), ' ]', 'failed at #444') - call g:assert.equals(getline(7), ' }', 'failed at #444') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #444') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #444') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #444') - call g:assert.equals(&l:autoindent, 1, 'failed at #444') - call g:assert.equals(&l:smartindent, 1, 'failed at #444') - call g:assert.equals(&l:cindent, 1, 'failed at #444') - call g:assert.equals(&l:indentexpr, '', 'failed at #444') + call g:assert.equals(getline(1), '{', 'failed at #441') + call g:assert.equals(getline(2), '[', 'failed at #441') + call g:assert.equals(getline(3), '', 'failed at #441') + call g:assert.equals(getline(4), ' foo', 'failed at #441') + call g:assert.equals(getline(5), '', 'failed at #441') + call g:assert.equals(getline(6), ']', 'failed at #441') + call g:assert.equals(getline(7), '}', 'failed at #441') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #441') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #441') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #441') + call g:assert.equals(&l:autoindent, 1, 'failed at #441') + call g:assert.equals(&l:smartindent, 1, 'failed at #441') + call g:assert.equals(&l:cindent, 1, 'failed at #441') + call g:assert.equals(&l:indentexpr, '', 'failed at #441') + + %delete + + " #442 + setlocal indentexpr=TestIndent() + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #442') + call g:assert.equals(getline(2), '[', 'failed at #442') + call g:assert.equals(getline(3), '', 'failed at #442') + call g:assert.equals(getline(4), ' foo', 'failed at #442') + call g:assert.equals(getline(5), '', 'failed at #442') + call g:assert.equals(getline(6), ']', 'failed at #442') + call g:assert.equals(getline(7), '}', 'failed at #442') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #442') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #442') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #442') + call g:assert.equals(&l:autoindent, 1, 'failed at #442') + call g:assert.equals(&l:smartindent, 1, 'failed at #442') + call g:assert.equals(&l:cindent, 1, 'failed at #442') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #442') + + %delete + + """ 1 + call operator#sandwich#set('replace', 'line', 'autoindent', 1) + + " #443 + setlocal noautoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), ' {', 'failed at #443') + call g:assert.equals(getline(2), ' [', 'failed at #443') + call g:assert.equals(getline(3), '', 'failed at #443') + call g:assert.equals(getline(4), ' foo', 'failed at #443') + call g:assert.equals(getline(5), '', 'failed at #443') + call g:assert.equals(getline(6), ' ]', 'failed at #443') + call g:assert.equals(getline(7), ' }', 'failed at #443') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #443') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #443') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #443') + call g:assert.equals(&l:autoindent, 0, 'failed at #443') + call g:assert.equals(&l:smartindent, 0, 'failed at #443') + call g:assert.equals(&l:cindent, 0, 'failed at #443') + call g:assert.equals(&l:indentexpr, '', 'failed at #443') + + %delete + + " #444 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), ' {', 'failed at #444') + call g:assert.equals(getline(2), ' [', 'failed at #444') + call g:assert.equals(getline(3), '', 'failed at #444') + call g:assert.equals(getline(4), ' foo', 'failed at #444') + call g:assert.equals(getline(5), '', 'failed at #444') + call g:assert.equals(getline(6), ' ]', 'failed at #444') + call g:assert.equals(getline(7), ' }', 'failed at #444') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #444') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #444') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #444') + call g:assert.equals(&l:autoindent, 1, 'failed at #444') + call g:assert.equals(&l:smartindent, 0, 'failed at #444') + call g:assert.equals(&l:cindent, 0, 'failed at #444') + call g:assert.equals(&l:indentexpr, '', 'failed at #444') %delete " #445 + setlocal smartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), ' {', 'failed at #445') + call g:assert.equals(getline(2), ' [', 'failed at #445') + call g:assert.equals(getline(3), '', 'failed at #445') + call g:assert.equals(getline(4), ' foo', 'failed at #445') + call g:assert.equals(getline(5), '', 'failed at #445') + call g:assert.equals(getline(6), ' ]', 'failed at #445') + call g:assert.equals(getline(7), ' }', 'failed at #445') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #445') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #445') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #445') + call g:assert.equals(&l:autoindent, 1, 'failed at #445') + call g:assert.equals(&l:smartindent, 1, 'failed at #445') + call g:assert.equals(&l:cindent, 0, 'failed at #445') + call g:assert.equals(&l:indentexpr, '', 'failed at #445') + + %delete + + " #446 + setlocal cindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), ' {', 'failed at #446') + call g:assert.equals(getline(2), ' [', 'failed at #446') + call g:assert.equals(getline(3), '', 'failed at #446') + call g:assert.equals(getline(4), ' foo', 'failed at #446') + call g:assert.equals(getline(5), '', 'failed at #446') + call g:assert.equals(getline(6), ' ]', 'failed at #446') + call g:assert.equals(getline(7), ' }', 'failed at #446') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #446') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #446') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #446') + call g:assert.equals(&l:autoindent, 1, 'failed at #446') + call g:assert.equals(&l:smartindent, 1, 'failed at #446') + call g:assert.equals(&l:cindent, 1, 'failed at #446') + call g:assert.equals(&l:indentexpr, '', 'failed at #446') + + %delete + + " #447 setlocal indentexpr=TestIndent() call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #445') - call g:assert.equals(getline(2), ' [', 'failed at #445') - call g:assert.equals(getline(3), '', 'failed at #445') - call g:assert.equals(getline(4), ' foo', 'failed at #445') - call g:assert.equals(getline(5), '', 'failed at #445') - call g:assert.equals(getline(6), ' ]', 'failed at #445') - call g:assert.equals(getline(7), ' }', 'failed at #445') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #445') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #445') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #445') - call g:assert.equals(&l:autoindent, 1, 'failed at #445') - call g:assert.equals(&l:smartindent, 1, 'failed at #445') - call g:assert.equals(&l:cindent, 1, 'failed at #445') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #445') + call g:assert.equals(getline(1), ' {', 'failed at #447') + call g:assert.equals(getline(2), ' [', 'failed at #447') + call g:assert.equals(getline(3), '', 'failed at #447') + call g:assert.equals(getline(4), ' foo', 'failed at #447') + call g:assert.equals(getline(5), '', 'failed at #447') + call g:assert.equals(getline(6), ' ]', 'failed at #447') + call g:assert.equals(getline(7), ' }', 'failed at #447') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #447') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #447') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #447') + call g:assert.equals(&l:autoindent, 1, 'failed at #447') + call g:assert.equals(&l:smartindent, 1, 'failed at #447') + call g:assert.equals(&l:cindent, 1, 'failed at #447') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #447') + + %delete + + """ 2 + call operator#sandwich#set('replace', 'line', 'autoindent', 2) + + " #448 + setlocal noautoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #448') + call g:assert.equals(getline(2), ' [', 'failed at #448') + call g:assert.equals(getline(3), '', 'failed at #448') + call g:assert.equals(getline(4), ' foo', 'failed at #448') + call g:assert.equals(getline(5), '', 'failed at #448') + call g:assert.equals(getline(6), ' ]', 'failed at #448') + call g:assert.equals(getline(7), '}', 'failed at #448') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #448') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #448') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #448') + call g:assert.equals(&l:autoindent, 0, 'failed at #448') + call g:assert.equals(&l:smartindent, 0, 'failed at #448') + call g:assert.equals(&l:cindent, 0, 'failed at #448') + call g:assert.equals(&l:indentexpr, '', 'failed at #448') + + %delete + + " #449 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #449') + call g:assert.equals(getline(2), ' [', 'failed at #449') + call g:assert.equals(getline(3), '', 'failed at #449') + call g:assert.equals(getline(4), ' foo', 'failed at #449') + call g:assert.equals(getline(5), '', 'failed at #449') + call g:assert.equals(getline(6), ' ]', 'failed at #449') + call g:assert.equals(getline(7), '}', 'failed at #449') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #449') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #449') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #449') + call g:assert.equals(&l:autoindent, 1, 'failed at #449') + call g:assert.equals(&l:smartindent, 0, 'failed at #449') + call g:assert.equals(&l:cindent, 0, 'failed at #449') + call g:assert.equals(&l:indentexpr, '', 'failed at #449') + + %delete + + " #450 + setlocal smartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #450') + call g:assert.equals(getline(2), ' [', 'failed at #450') + call g:assert.equals(getline(3), '', 'failed at #450') + call g:assert.equals(getline(4), ' foo', 'failed at #450') + call g:assert.equals(getline(5), '', 'failed at #450') + call g:assert.equals(getline(6), ' ]', 'failed at #450') + call g:assert.equals(getline(7), '}', 'failed at #450') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #450') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #450') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #450') + call g:assert.equals(&l:autoindent, 1, 'failed at #450') + call g:assert.equals(&l:smartindent, 1, 'failed at #450') + call g:assert.equals(&l:cindent, 0, 'failed at #450') + call g:assert.equals(&l:indentexpr, '', 'failed at #450') + + %delete + + " #451 + setlocal cindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #451') + call g:assert.equals(getline(2), ' [', 'failed at #451') + call g:assert.equals(getline(3), '', 'failed at #451') + call g:assert.equals(getline(4), ' foo', 'failed at #451') + call g:assert.equals(getline(5), '', 'failed at #451') + call g:assert.equals(getline(6), ' ]', 'failed at #451') + call g:assert.equals(getline(7), '}', 'failed at #451') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #451') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #451') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #451') + call g:assert.equals(&l:autoindent, 1, 'failed at #451') + call g:assert.equals(&l:smartindent, 1, 'failed at #451') + call g:assert.equals(&l:cindent, 1, 'failed at #451') + call g:assert.equals(&l:indentexpr, '', 'failed at #451') + + %delete + + " #452 + setlocal indentexpr=TestIndent() + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #452') + call g:assert.equals(getline(2), ' [', 'failed at #452') + call g:assert.equals(getline(3), '', 'failed at #452') + call g:assert.equals(getline(4), ' foo', 'failed at #452') + call g:assert.equals(getline(5), '', 'failed at #452') + call g:assert.equals(getline(6), ' ]', 'failed at #452') + call g:assert.equals(getline(7), '}', 'failed at #452') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #452') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #452') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #452') + call g:assert.equals(&l:autoindent, 1, 'failed at #452') + call g:assert.equals(&l:smartindent, 1, 'failed at #452') + call g:assert.equals(&l:cindent, 1, 'failed at #452') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #452') + + %delete + + """ 3 + call operator#sandwich#set('replace', 'line', 'autoindent', 3) + + " #453 + setlocal noautoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #453') + call g:assert.equals(getline(2), ' [', 'failed at #453') + call g:assert.equals(getline(3), '', 'failed at #453') + call g:assert.equals(getline(4), ' foo', 'failed at #453') + call g:assert.equals(getline(5), '', 'failed at #453') + call g:assert.equals(getline(6), ' ]', 'failed at #453') + call g:assert.equals(getline(7), ' }', 'failed at #453') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #453') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #453') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #453') + call g:assert.equals(&l:autoindent, 0, 'failed at #453') + call g:assert.equals(&l:smartindent, 0, 'failed at #453') + call g:assert.equals(&l:cindent, 0, 'failed at #453') + call g:assert.equals(&l:indentexpr, '', 'failed at #453') + + %delete + + " #454 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #454') + call g:assert.equals(getline(2), ' [', 'failed at #454') + call g:assert.equals(getline(3), '', 'failed at #454') + call g:assert.equals(getline(4), ' foo', 'failed at #454') + call g:assert.equals(getline(5), '', 'failed at #454') + call g:assert.equals(getline(6), ' ]', 'failed at #454') + call g:assert.equals(getline(7), ' }', 'failed at #454') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #454') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #454') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #454') + call g:assert.equals(&l:autoindent, 1, 'failed at #454') + call g:assert.equals(&l:smartindent, 0, 'failed at #454') + call g:assert.equals(&l:cindent, 0, 'failed at #454') + call g:assert.equals(&l:indentexpr, '', 'failed at #454') + + %delete + + " #455 + setlocal smartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #455') + call g:assert.equals(getline(2), ' [', 'failed at #455') + call g:assert.equals(getline(3), '', 'failed at #455') + call g:assert.equals(getline(4), ' foo', 'failed at #455') + call g:assert.equals(getline(5), '', 'failed at #455') + call g:assert.equals(getline(6), ' ]', 'failed at #455') + call g:assert.equals(getline(7), ' }', 'failed at #455') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #455') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #455') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #455') + call g:assert.equals(&l:autoindent, 1, 'failed at #455') + call g:assert.equals(&l:smartindent, 1, 'failed at #455') + call g:assert.equals(&l:cindent, 0, 'failed at #455') + call g:assert.equals(&l:indentexpr, '', 'failed at #455') + + %delete + + " #456 + setlocal cindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #456') + call g:assert.equals(getline(2), ' [', 'failed at #456') + call g:assert.equals(getline(3), '', 'failed at #456') + call g:assert.equals(getline(4), ' foo', 'failed at #456') + call g:assert.equals(getline(5), '', 'failed at #456') + call g:assert.equals(getline(6), ' ]', 'failed at #456') + call g:assert.equals(getline(7), ' }', 'failed at #456') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #456') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #456') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #456') + call g:assert.equals(&l:autoindent, 1, 'failed at #456') + call g:assert.equals(&l:smartindent, 1, 'failed at #456') + call g:assert.equals(&l:cindent, 1, 'failed at #456') + call g:assert.equals(&l:indentexpr, '', 'failed at #456') + + %delete + + " #457 + setlocal indentexpr=TestIndent() + call append(0, [' "', ' foo', ' "']) + normal ggsrV2ja + call g:assert.equals(getline(1), '{', 'failed at #457') + call g:assert.equals(getline(2), ' [', 'failed at #457') + call g:assert.equals(getline(3), '', 'failed at #457') + call g:assert.equals(getline(4), ' foo', 'failed at #457') + call g:assert.equals(getline(5), '', 'failed at #457') + call g:assert.equals(getline(6), ' ]', 'failed at #457') + call g:assert.equals(getline(7), ' }', 'failed at #457') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #457') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #457') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #457') + call g:assert.equals(&l:autoindent, 1, 'failed at #457') + call g:assert.equals(&l:smartindent, 1, 'failed at #457') + call g:assert.equals(&l:cindent, 1, 'failed at #457') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #457') endfunction "}}} function! s:suite.linewise_n_option_indentkeys() abort "{{{ @@ -5490,7 +5556,7 @@ function! s:suite.linewise_n_option_indentkeys() abort "{{{ """ cinkeys call operator#sandwich#set('replace', 'line', 'autoindent', 3) - " #446 + " #458 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -5498,23 +5564,23 @@ function! s:suite.linewise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys', '0{,0},0),:,0#,!^F,e') call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #446') - call g:assert.equals(getline(2), '', 'failed at #446') - call g:assert.equals(getline(3), ' foo', 'failed at #446') - call g:assert.equals(getline(4), '', 'failed at #446') - call g:assert.equals(getline(5), ' }', 'failed at #446') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #446') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #446') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #446') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #446') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #446') + call g:assert.equals(getline(1), '{', 'failed at #458') + call g:assert.equals(getline(2), '', 'failed at #458') + call g:assert.equals(getline(3), ' foo', 'failed at #458') + call g:assert.equals(getline(4), '', 'failed at #458') + call g:assert.equals(getline(5), ' }', 'failed at #458') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #458') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #458') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #458') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #458') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #458') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', 3) - " #447 + " #459 setlocal cinkeys=0{,0},0),:,0#,!^F,e setlocal indentkeys& let cinkeys = &l:cinkeys @@ -5522,23 +5588,23 @@ function! s:suite.linewise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys+', 'O,o') call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #447') - call g:assert.equals(getline(2), '', 'failed at #447') - call g:assert.equals(getline(3), ' foo', 'failed at #447') - call g:assert.equals(getline(4), '', 'failed at #447') - call g:assert.equals(getline(5), ' }', 'failed at #447') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #447') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #447') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #447') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #447') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #447') + call g:assert.equals(getline(1), '{', 'failed at #459') + call g:assert.equals(getline(2), '', 'failed at #459') + call g:assert.equals(getline(3), ' foo', 'failed at #459') + call g:assert.equals(getline(4), '', 'failed at #459') + call g:assert.equals(getline(5), ' }', 'failed at #459') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #459') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #459') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #459') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #459') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #459') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', 3) - " #448 + " #460 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -5546,16 +5612,16 @@ function! s:suite.linewise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys-', 'O,o') call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), '{', 'failed at #448') - call g:assert.equals(getline(2), '', 'failed at #448') - call g:assert.equals(getline(3), ' foo', 'failed at #448') - call g:assert.equals(getline(4), '', 'failed at #448') - call g:assert.equals(getline(5), ' }', 'failed at #448') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #448') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #448') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #448') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #448') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #448') + call g:assert.equals(getline(1), '{', 'failed at #460') + call g:assert.equals(getline(2), '', 'failed at #460') + call g:assert.equals(getline(3), ' foo', 'failed at #460') + call g:assert.equals(getline(4), '', 'failed at #460') + call g:assert.equals(getline(5), ' }', 'failed at #460') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #460') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #460') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #460') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #460') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #460') %delete call operator#sandwich#set_default() @@ -5565,7 +5631,7 @@ function! s:suite.linewise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', -1) - " #449 + " #461 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -5573,23 +5639,23 @@ function! s:suite.linewise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys', '0{,0},0),:,0#,!^F,e') call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), ' {', 'failed at #449') - call g:assert.equals(getline(2), '', 'failed at #449') - call g:assert.equals(getline(3), ' foo', 'failed at #449') - call g:assert.equals(getline(4), '', 'failed at #449') - call g:assert.equals(getline(5), ' }', 'failed at #449') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #449') - " call g:assert.equals(getpos("'["), [0, 1, 8, 0], 'failed at #449') - " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #449') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #449') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #449') + call g:assert.equals(getline(1), ' {', 'failed at #461') + call g:assert.equals(getline(2), '', 'failed at #461') + call g:assert.equals(getline(3), ' foo', 'failed at #461') + call g:assert.equals(getline(4), '', 'failed at #461') + call g:assert.equals(getline(5), ' }', 'failed at #461') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #461') + " call g:assert.equals(getpos("'["), [0, 1, 8, 0], 'failed at #461') + " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #461') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #461') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #461') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', -1) - " #450 + " #462 setlocal cinkeys& setlocal indentkeys=0{,0},0),:,0#,!^F,e let cinkeys = &l:cinkeys @@ -5597,23 +5663,23 @@ function! s:suite.linewise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys+', 'O,o') call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), ' {', 'failed at #450') - call g:assert.equals(getline(2), '', 'failed at #450') - call g:assert.equals(getline(3), ' foo', 'failed at #450') - call g:assert.equals(getline(4), '', 'failed at #450') - call g:assert.equals(getline(5), ' }', 'failed at #450') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #450') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #450') - " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #450') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #450') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #450') + call g:assert.equals(getline(1), ' {', 'failed at #462') + call g:assert.equals(getline(2), '', 'failed at #462') + call g:assert.equals(getline(3), ' foo', 'failed at #462') + call g:assert.equals(getline(4), '', 'failed at #462') + call g:assert.equals(getline(5), ' }', 'failed at #462') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #462') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #462') + " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #462') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #462') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #462') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', -1) - " #451 + " #463 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -5621,242 +5687,242 @@ function! s:suite.linewise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys-', 'O,o') call append(0, [' "', ' foo', ' "']) normal ggsrV2ja - call g:assert.equals(getline(1), ' {', 'failed at #451') - call g:assert.equals(getline(2), '', 'failed at #451') - call g:assert.equals(getline(3), ' foo', 'failed at #451') - call g:assert.equals(getline(4), '', 'failed at #451') - call g:assert.equals(getline(5), ' }', 'failed at #451') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #451') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #451') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #451') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #451') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #451') + call g:assert.equals(getline(1), ' {', 'failed at #463') + call g:assert.equals(getline(2), '', 'failed at #463') + call g:assert.equals(getline(3), ' foo', 'failed at #463') + call g:assert.equals(getline(4), '', 'failed at #463') + call g:assert.equals(getline(5), ' }', 'failed at #463') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #463') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #463') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #463') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #463') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #463') endfunction "}}} function! s:suite.linewise_x_default_recipes() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - " #452 + " #464 call setline('.', '(foo)') normal Vsr[ - call g:assert.equals(getline('.'), '[foo]', 'failed at #452') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #452') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #452') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #452') + call g:assert.equals(getline('.'), '[foo]', 'failed at #464') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #464') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #464') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #464') - " #453 + " #465 call setline('.', '[foo]') normal Vsr{ - call g:assert.equals(getline('.'), '{foo}', 'failed at #453') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #453') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #453') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #453') + call g:assert.equals(getline('.'), '{foo}', 'failed at #465') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #465') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #465') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #465') - " #454 + " #466 call setline('.', '{foo}') normal Vsr< - call g:assert.equals(getline('.'), '', 'failed at #454') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #454') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #454') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #454') + call g:assert.equals(getline('.'), '', 'failed at #466') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #466') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #466') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #466') - " #455 + " #467 call setline('.', '') normal Vsr( - call g:assert.equals(getline('.'), '(foo)', 'failed at #455') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #455') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #455') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #455') + call g:assert.equals(getline('.'), '(foo)', 'failed at #467') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #467') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #467') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #467') %delete - " #456 + " #468 call append(0, ['(', 'foo', ')']) normal ggV2jsr] - call g:assert.equals(getline(1), '[', 'failed at #456') - call g:assert.equals(getline(2), 'foo', 'failed at #456') - call g:assert.equals(getline(3), ']', 'failed at #456') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #456') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #456') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #456') + call g:assert.equals(getline(1), '[', 'failed at #468') + call g:assert.equals(getline(2), 'foo', 'failed at #468') + call g:assert.equals(getline(3), ']', 'failed at #468') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #468') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #468') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #468') - " #457 + " #469 call append(0, ['[', 'foo', ']']) normal ggV2jsr} - call g:assert.equals(getline(1), '{', 'failed at #457') - call g:assert.equals(getline(2), 'foo', 'failed at #457') - call g:assert.equals(getline(3), '}', 'failed at #457') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #457') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #457') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #457') + call g:assert.equals(getline(1), '{', 'failed at #469') + call g:assert.equals(getline(2), 'foo', 'failed at #469') + call g:assert.equals(getline(3), '}', 'failed at #469') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #469') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #469') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #469') - " #458 + " #470 call append(0, ['{', 'foo', '}']) normal ggV2jsr> - call g:assert.equals(getline(1), '<', 'failed at #458') - call g:assert.equals(getline(2), 'foo', 'failed at #458') - call g:assert.equals(getline(3), '>', 'failed at #458') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #458') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #458') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #458') + call g:assert.equals(getline(1), '<', 'failed at #470') + call g:assert.equals(getline(2), 'foo', 'failed at #470') + call g:assert.equals(getline(3), '>', 'failed at #470') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #470') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #470') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #470') - " #459 + " #471 call append(0, ['<', 'foo', '>']) normal ggV2jsr) - call g:assert.equals(getline(1), '(', 'failed at #459') - call g:assert.equals(getline(2), 'foo', 'failed at #459') - call g:assert.equals(getline(3), ')', 'failed at #459') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #459') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #459') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #459') + call g:assert.equals(getline(1), '(', 'failed at #471') + call g:assert.equals(getline(2), 'foo', 'failed at #471') + call g:assert.equals(getline(3), ')', 'failed at #471') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #471') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #471') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #471') endfunction "}}} function! s:suite.linewise_x_not_registered() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - " #460 + " #472 call setline('.', 'afooa') normal Vsrb - call g:assert.equals(getline('.'), 'bfoob', 'failed at #460') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #460') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #460') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #460') + call g:assert.equals(getline('.'), 'bfoob', 'failed at #472') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #472') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #472') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #472') - " #461 + " #473 call setline('.', '+foo+') normal Vsr* - call g:assert.equals(getline('.'), '*foo*', 'failed at #461') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #461') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #461') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #461') + call g:assert.equals(getline('.'), '*foo*', 'failed at #473') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #473') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #473') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #473') %delete - " #460 + " #472 call append(0, ['a', 'foo', 'a']) normal ggV2jsrb - call g:assert.equals(getline(1), 'b', 'failed at #460') - call g:assert.equals(getline(2), 'foo', 'failed at #460') - call g:assert.equals(getline(3), 'b', 'failed at #460') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #460') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #460') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #460') + call g:assert.equals(getline(1), 'b', 'failed at #472') + call g:assert.equals(getline(2), 'foo', 'failed at #472') + call g:assert.equals(getline(3), 'b', 'failed at #472') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #472') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #472') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #472') %delete - " #461 + " #473 call append(0, ['+', 'foo', '+']) normal ggV2jsr* - call g:assert.equals(getline(1), '*', 'failed at #461') - call g:assert.equals(getline(2), 'foo', 'failed at #461') - call g:assert.equals(getline(3), '*', 'failed at #461') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #461') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #461') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #461') + call g:assert.equals(getline(1), '*', 'failed at #473') + call g:assert.equals(getline(2), 'foo', 'failed at #473') + call g:assert.equals(getline(3), '*', 'failed at #473') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #473') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #473') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #473') endfunction "}}} function! s:suite.linewise_x_positioning() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - " #462 + " #474 call append(0, ['(', 'foo', 'bar', 'baz', ')']) normal ggV4jsr[ - call g:assert.equals(getline(1), '[', 'failed at #462') - call g:assert.equals(getline(2), 'foo', 'failed at #462') - call g:assert.equals(getline(3), 'bar', 'failed at #462') - call g:assert.equals(getline(4), 'baz', 'failed at #462') - call g:assert.equals(getline(5), ']', 'failed at #462') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #462') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #462') - call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #462') + call g:assert.equals(getline(1), '[', 'failed at #474') + call g:assert.equals(getline(2), 'foo', 'failed at #474') + call g:assert.equals(getline(3), 'bar', 'failed at #474') + call g:assert.equals(getline(4), 'baz', 'failed at #474') + call g:assert.equals(getline(5), ']', 'failed at #474') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #474') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #474') + call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #474') %delete - " #463 + " #475 call append(0, ['foo', '(', 'bar', ')', 'baz']) normal ggjV2jsr[ - call g:assert.equals(getline(1), 'foo', 'failed at #463') - call g:assert.equals(getline(2), '[', 'failed at #463') - call g:assert.equals(getline(3), 'bar', 'failed at #463') - call g:assert.equals(getline(4), ']', 'failed at #463') - call g:assert.equals(getline(5), 'baz', 'failed at #463') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #463') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #463') - call g:assert.equals(getpos("']"), [0, 4, 2, 0], 'failed at #463') + call g:assert.equals(getline(1), 'foo', 'failed at #475') + call g:assert.equals(getline(2), '[', 'failed at #475') + call g:assert.equals(getline(3), 'bar', 'failed at #475') + call g:assert.equals(getline(4), ']', 'failed at #475') + call g:assert.equals(getline(5), 'baz', 'failed at #475') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #475') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #475') + call g:assert.equals(getpos("']"), [0, 4, 2, 0], 'failed at #475') %delete - " #464 + " #476 call append(0, ['(foo', 'bar', 'baz)']) normal ggV2jsr[ - call g:assert.equals(getline(1), '[foo', 'failed at #464') - call g:assert.equals(getline(2), 'bar', 'failed at #464') - call g:assert.equals(getline(3), 'baz]', 'failed at #464') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #464') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #464') - call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #464') + call g:assert.equals(getline(1), '[foo', 'failed at #476') + call g:assert.equals(getline(2), 'bar', 'failed at #476') + call g:assert.equals(getline(3), 'baz]', 'failed at #476') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #476') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #476') + call g:assert.equals(getpos("']"), [0, 3, 5, 0], 'failed at #476') endfunction "}}} function! s:suite.linewise_x_nothing_inside() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - " #465 + " #477 call setline('.', '()') normal Vsr[ - call g:assert.equals(getline('.'), '[]', 'failed at #465') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #465') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #465') - call g:assert.equals(getpos("']"), [0, 1, 3, 0], 'failed at #465') + call g:assert.equals(getline('.'), '[]', 'failed at #477') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #477') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #477') + call g:assert.equals(getpos("']"), [0, 1, 3, 0], 'failed at #477') %delete - " #466 + " #478 call append(0, ['(', ')']) normal ggVjsr[ - call g:assert.equals(getline(1), '[', 'failed at #466') - call g:assert.equals(getline(2), ']', 'failed at #466') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #466') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #466') - call g:assert.equals(getpos("']"), [0, 2, 2, 0], 'failed at #466') + call g:assert.equals(getline(1), '[', 'failed at #478') + call g:assert.equals(getline(2), ']', 'failed at #478') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #478') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #478') + call g:assert.equals(getpos("']"), [0, 2, 2, 0], 'failed at #478') endfunction "}}} function! s:suite.linewise_x_count() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - " #467 + " #479 call setline('.', '([foo])') normal V2sr[( - call g:assert.equals(getline('.'), '[(foo)]', 'failed at #467') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #467') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #467') - call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #467') + call g:assert.equals(getline('.'), '[(foo)]', 'failed at #479') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #479') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #479') + call g:assert.equals(getpos("']"), [0, 1, 8, 0], 'failed at #479') - " #468 + " #480 call setline('.', '[({foo})]') normal V3sr{[( - call g:assert.equals(getline('.'), '{[(foo)]}', 'failed at #468') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #468') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #468') - call g:assert.equals(getpos("']"), [0, 1, 10, 0], 'failed at #468') + call g:assert.equals(getline('.'), '{[(foo)]}', 'failed at #480') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #480') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #480') + call g:assert.equals(getpos("']"), [0, 1, 10, 0], 'failed at #480') %delete - " #469 + " #481 call append(0, ['foo', '{', '[', '(', 'bar', ')', ']', '}', 'baz']) normal ggjV6j3sr({[ - call g:assert.equals(getline(1), 'foo', 'failed at #469') - call g:assert.equals(getline(2), '(', 'failed at #469') - call g:assert.equals(getline(3), '{', 'failed at #469') - call g:assert.equals(getline(4), '[', 'failed at #469') - call g:assert.equals(getline(5), 'bar', 'failed at #469') - call g:assert.equals(getline(6), ']', 'failed at #469') - call g:assert.equals(getline(7), '}', 'failed at #469') - call g:assert.equals(getline(8), ')', 'failed at #469') - call g:assert.equals(getline(9), 'baz', 'failed at #469') - call g:assert.equals(getpos('.'), [0, 5, 1, 0], 'failed at #469') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #469') - call g:assert.equals(getpos("']"), [0, 8, 2, 0], 'failed at #469') + call g:assert.equals(getline(1), 'foo', 'failed at #481') + call g:assert.equals(getline(2), '(', 'failed at #481') + call g:assert.equals(getline(3), '{', 'failed at #481') + call g:assert.equals(getline(4), '[', 'failed at #481') + call g:assert.equals(getline(5), 'bar', 'failed at #481') + call g:assert.equals(getline(6), ']', 'failed at #481') + call g:assert.equals(getline(7), '}', 'failed at #481') + call g:assert.equals(getline(8), ')', 'failed at #481') + call g:assert.equals(getline(9), 'baz', 'failed at #481') + call g:assert.equals(getpos('.'), [0, 5, 1, 0], 'failed at #481') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #481') + call g:assert.equals(getpos("']"), [0, 8, 2, 0], 'failed at #481') endfunction "}}} function! s:suite.linewise_x_breaking() abort "{{{ @@ -5867,77 +5933,77 @@ function! s:suite.linewise_x_breaking() abort "{{{ \ {'buns': ["bb\nbbb\nbb", "bb\nbbb\nbb"], 'input':['b']}, \ ] - " #470 + " #482 call append(0, ['aa', 'aaafooaaa', 'aa']) normal ggV2jsr( - call g:assert.equals(getline(1), '(foo)', 'failed at #470') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #470') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #470') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #470') + call g:assert.equals(getline(1), '(foo)', 'failed at #482') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #482') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #482') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #482') %delete - " #471 + " #483 call append(0, ['bb', 'bbb', 'bbfoobb', 'bbb', 'bb']) normal ggV4jsr( - call g:assert.equals(getline(1), '(foo)', 'failed at #471') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #471') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #471') - call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #471') + call g:assert.equals(getline(1), '(foo)', 'failed at #483') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #483') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #483') + call g:assert.equals(getpos("']"), [0, 1, 6, 0], 'failed at #483') %delete - " #472 + " #484 call setline('.', '(foo)') normal Vsra - call g:assert.equals(getline(1), 'aa', 'failed at #472') - call g:assert.equals(getline(2), 'aaafooaaa', 'failed at #472') - call g:assert.equals(getline(3), 'aa', 'failed at #472') - call g:assert.equals(getpos('.'), [0, 2, 4, 0], 'failed at #472') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #472') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #472') + call g:assert.equals(getline(1), 'aa', 'failed at #484') + call g:assert.equals(getline(2), 'aaafooaaa', 'failed at #484') + call g:assert.equals(getline(3), 'aa', 'failed at #484') + call g:assert.equals(getpos('.'), [0, 2, 4, 0], 'failed at #484') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #484') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #484') %delete - " #473 + " #485 call setline('.', '(foo)') normal Vsrb - call g:assert.equals(getline(1), 'bb', 'failed at #473') - call g:assert.equals(getline(2), 'bbb', 'failed at #473') - call g:assert.equals(getline(3), 'bbfoobb', 'failed at #473') - call g:assert.equals(getline(4), 'bbb', 'failed at #473') - call g:assert.equals(getline(5), 'bb', 'failed at #473') - call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #473') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #473') - call g:assert.equals(getpos("']"), [0, 5, 3, 0], 'failed at #473') + call g:assert.equals(getline(1), 'bb', 'failed at #485') + call g:assert.equals(getline(2), 'bbb', 'failed at #485') + call g:assert.equals(getline(3), 'bbfoobb', 'failed at #485') + call g:assert.equals(getline(4), 'bbb', 'failed at #485') + call g:assert.equals(getline(5), 'bb', 'failed at #485') + call g:assert.equals(getpos('.'), [0, 3, 3, 0], 'failed at #485') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #485') + call g:assert.equals(getpos("']"), [0, 5, 3, 0], 'failed at #485') %delete - " #474 + " #486 call append(0, ['aa', 'aaa', 'aa', 'aaa', 'foo', 'aaa', 'aa', 'aaa', 'aa']) normal ggV8j2sr(( - call g:assert.equals(getline(1), '(', 'failed at #474') - call g:assert.equals(getline(2), '(', 'failed at #474') - call g:assert.equals(getline(3), 'foo', 'failed at #474') - call g:assert.equals(getline(4), ')', 'failed at #474') - call g:assert.equals(getline(5), ')', 'failed at #474') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #474') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #474') - call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #474') + call g:assert.equals(getline(1), '(', 'failed at #486') + call g:assert.equals(getline(2), '(', 'failed at #486') + call g:assert.equals(getline(3), 'foo', 'failed at #486') + call g:assert.equals(getline(4), ')', 'failed at #486') + call g:assert.equals(getline(5), ')', 'failed at #486') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #486') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #486') + call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #486') %delete - " #475 + " #487 call append(0, ['bb', 'bbb', 'bb', 'bb', 'bbb', 'bb', 'foo', 'bb', 'bbb', 'bb', 'bb', 'bbb', 'bb']) normal ggV12j2sr(( - call g:assert.equals(getline(1), '(', 'failed at #475') - call g:assert.equals(getline(2), '(', 'failed at #475') - call g:assert.equals(getline(3), 'foo', 'failed at #475') - call g:assert.equals(getline(4), ')', 'failed at #475') - call g:assert.equals(getline(5), ')', 'failed at #475') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #475') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #475') - call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #475') + call g:assert.equals(getline(1), '(', 'failed at #487') + call g:assert.equals(getline(2), '(', 'failed at #487') + call g:assert.equals(getline(3), 'foo', 'failed at #487') + call g:assert.equals(getline(4), ')', 'failed at #487') + call g:assert.equals(getline(5), ')', 'failed at #487') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #487') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #487') + call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #487') unlet! g:operator#sandwich#recipes endfunction @@ -5953,25 +6019,25 @@ function! s:suite.linewise_x_external_textobj() abort"{{{ \ {'external': ['it', 'at']}, \ ] - " #476 + " #488 call setline('.', '(foo)') normal Vsr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #476') + call g:assert.equals(getline('.'), '"foo"', 'failed at #488') - " #477 + " #489 call setline('.', '[foo]') normal Vsr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #477') + call g:assert.equals(getline('.'), '"foo"', 'failed at #489') - " #478 + " #490 call setline('.', '{foo}') normal Vsr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #478') + call g:assert.equals(getline('.'), '"foo"', 'failed at #490') - " #479 + " #491 call setline('.', 'foo') normal Vsr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #479') + call g:assert.equals(getline('.'), '"foo"', 'failed at #491') unlet g:sandwich#recipes unlet g:operator#sandwich#recipes @@ -5982,68 +6048,68 @@ function! s:suite.linewise_x_option_cursor() abort "{{{ """"" cursor """ inner_head - " #480 + " #492 call setline('.', '(((foo)))') normal 0V2sr[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #480') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #480') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #492') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #492') - " #481 + " #493 normal Vsr( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #481') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #481') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #493') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #493') """ keep - " #482 + " #494 call operator#sandwich#set('replace', 'line', 'cursor', 'keep') call setline('.', '(((foo)))') normal 04lV2sr[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #482') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #482') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #494') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #494') - " #483 + " #495 normal lVsr( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #483') - call g:assert.equals(getpos('.'), [0, 1, 6, 0], 'failed at #483') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #495') + call g:assert.equals(getpos('.'), [0, 1, 6, 0], 'failed at #495') """ inner_tail - " #484 + " #496 call operator#sandwich#set('replace', 'line', 'cursor', 'inner_tail') call setline('.', '(((foo)))') normal 04lV2sr[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #484') - call g:assert.equals(getpos('.'), [0, 1, 7, 0], 'failed at #484') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #496') + call g:assert.equals(getpos('.'), [0, 1, 7, 0], 'failed at #496') - " #485 + " #497 normal hVsr( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #485') - call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #485') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #497') + call g:assert.equals(getpos('.'), [0, 1, 8, 0], 'failed at #497') """ head - " #486 + " #498 call operator#sandwich#set('replace', 'line', 'cursor', 'head') call setline('.', '(((foo)))') normal 04lV2sr[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #486') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #486') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #498') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #498') - " #487 + " #499 normal 3lVsr( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #487') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #487') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #499') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #499') """ tail - " #488 + " #500 call operator#sandwich#set('replace', 'line', 'cursor', 'tail') call setline('.', '(((foo)))') normal 04lV2sr[[ - call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #488') - call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #488') + call g:assert.equals(getline('.'), '[[(foo)]]', 'failed at #500') + call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #500') - " #489 + " #501 normal 3hVsr( - call g:assert.equals(getline('.'), '([(foo)])', 'failed at #489') - call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #489') + call g:assert.equals(getline('.'), '([(foo)])', 'failed at #501') + call g:assert.equals(getpos('.'), [0, 1, 9, 0], 'failed at #501') call operator#sandwich#set('replace', 'line', 'cursor', 'inner_head') endfunction @@ -6058,27 +6124,27 @@ function! s:suite.linewise_x_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #490 + " #502 call setline('.', '{foo}') normal Vsr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #490') + call g:assert.equals(getline('.'), '"foo"', 'failed at #502') - " #491 + " #503 call setline('.', '(foo)') normal Vsr" - call g:assert.equals(getline('.'), '(foo)', 'failed at #491') + call g:assert.equals(getline('.'), '(foo)', 'failed at #503') """ off - " #492 + " #504 call operator#sandwich#set('replace', 'line', 'noremap', 0) call setline('.', '{foo}') normal Vsr" - call g:assert.equals(getline('.'), '{foo}', 'failed at #492') + call g:assert.equals(getline('.'), '{foo}', 'failed at #504') - " #493 + " #505 call setline('.', '(foo)') normal Vsr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #493') + call g:assert.equals(getline('.'), '"foo"', 'failed at #505') unlet! g:sandwich#recipes unlet! g:operator#sandwich#recipes @@ -6094,27 +6160,27 @@ function! s:suite.linewise_x_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #494 + " #506 call setline('.', '\d\+foo\d\+') normal Vsr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #494') + call g:assert.equals(getline('.'), '"foo"', 'failed at #506') - " #495 + " #507 call setline('.', '888foo888') normal Vsr" - call g:assert.equals(getline('.'), '"88foo88"', 'failed at #495') + call g:assert.equals(getline('.'), '"88foo88"', 'failed at #507') """ on call operator#sandwich#set('replace', 'line', 'regex', 1) - " #496 + " #508 call setline('.', '\d\+foo\d\+') normal Vsr" - call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #496') + call g:assert.equals(getline('.'), '\d\+foo\d\+', 'failed at #508') - " #497 + " #509 call setline('.', '888foo888') normal Vsr" - call g:assert.equals(getline('.'), '"foo"', 'failed at #497') + call g:assert.equals(getline('.'), '"foo"', 'failed at #509') call operator#sandwich#set('replace', 'line', 'regex', 0) unlet! g:sandwich#recipes @@ -6124,50 +6190,72 @@ endfunction function! s:suite.linewise_x_option_skip_space() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) - """ on - " #498 + """ 2 + " #510 call setline('.', '"foo"') normal Vsr( - call g:assert.equals(getline('.'), '(foo)', 'failed at #498') + call g:assert.equals(getline('.'), '(foo)', 'failed at #510') - " #499 + " #511 call setline('.', ' "foo"') normal Vsr( - call g:assert.equals(getline('.'), ' (foo)', 'failed at #499') + call g:assert.equals(getline('.'), ' (foo)', 'failed at #511') - " #500 + " #512 call setline('.', '"foo" ') normal Vsr( - call g:assert.equals(getline('.'), '(foo) ', 'failed at #500') + call g:assert.equals(getline('.'), '(foo) ', 'failed at #512') - " #501 + " #513 + call setline('.', ' "foo" ') + normal Vsr( + call g:assert.equals(getline('.'), ' (foo) ', 'failed at #513') + + """ 1 + call operator#sandwich#set('replace', 'line', 'skip_space', 1) + " #514 + call setline('.', '"foo"') + normal Vsr( + call g:assert.equals(getline('.'), '(foo)', 'failed at #514') + + " #515 + call setline('.', ' "foo"') + normal Vsr( + call g:assert.equals(getline('.'), ' (foo)', 'failed at #515') + + " #516 + call setline('.', '"foo" ') + normal Vsr( + call g:assert.equals(getline('.'), '(foo) ', 'failed at #516') + + " #517 " do not skip! call setline('.', ' "foo" ') normal Vsr( - call g:assert.equals(getline('.'), '("foo")', 'failed at #501') + call g:assert.equals(getline('.'), '("foo")', 'failed at #517') - """ off + """ 0 call operator#sandwich#set('replace', 'line', 'skip_space', 0) - " #502 + " #518 call setline('.', '"foo"') normal Vsr( - call g:assert.equals(getline('.'), '(foo)', 'failed at #502') + call g:assert.equals(getline('.'), '(foo)', 'failed at #518') - " #503 + " #519 call setline('.', ' "foo"') normal Vsr( - call g:assert.equals(getline('.'), ' "foo"', 'failed at #503') + call g:assert.equals(getline('.'), ' "foo"', 'failed at #519') - " #504 + " #520 call setline('.', '"foo" ') normal Vsr( - call g:assert.equals(getline('.'), '"foo" ', 'failed at #504') + call g:assert.equals(getline('.'), '"foo" ', 'failed at #520') - " #505 + " #521 " do not skip! call setline('.', ' "foo" ') normal Vsr( - call g:assert.equals(getline('.'), '("foo")', 'failed at #505') + call g:assert.equals(getline('.'), '("foo")', 'failed at #521') call operator#sandwich#set('replace', 'line', 'skip_space', 1) endfunction @@ -6176,17 +6264,17 @@ function! s:suite.linewise_x_option_skip_char() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 1) """ off - " #506 + " #522 call setline('.', 'aa(foo)bb') normal Vsr" - call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #506') + call g:assert.equals(getline('.'), 'aa(foo)bb', 'failed at #522') """ on call operator#sandwich#set('replace', 'line', 'skip_char', 1) - " #507 + " #523 call setline('.', 'aa(foo)bb') normal Vsr" - call g:assert.equals(getline('.'), 'aa"foo"bb', 'failed at #507') + call g:assert.equals(getline('.'), 'aa"foo"bb', 'failed at #523') call operator#sandwich#set('replace', 'line', 'skip_char', 0) endfunction @@ -6196,10 +6284,10 @@ function! s:suite.linewise_x_option_command() abort "{{{ call operator#sandwich#set('replace', 'line', 'command', ['normal! `[dv`]']) - " #508 + " #524 call setline('.', '(foo)') normal Vsr" - call g:assert.equals(getline('.'), '""', 'failed at #508') + call g:assert.equals(getline('.'), '""', 'failed at #524') call operator#sandwich#set('replace', 'line', 'command', []) endfunction @@ -6210,116 +6298,116 @@ function! s:suite.linewise_x_option_linewise() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 0) """ 0 - " #509 + " #525 call append(0, ['(', 'foo', ')']) normal ggV2jsr[ - call g:assert.equals(getline(1), '[', 'failed at #509') - call g:assert.equals(getline(2), 'foo', 'failed at #509') - call g:assert.equals(getline(3), ']', 'failed at #509') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #509') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #509') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #509') + call g:assert.equals(getline(1), '[', 'failed at #525') + call g:assert.equals(getline(2), 'foo', 'failed at #525') + call g:assert.equals(getline(3), ']', 'failed at #525') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #525') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #525') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #525') %delete - " #510 + " #526 call append(0, ['( ', 'foo', ' )']) normal ggV2jsr[ - call g:assert.equals(getline(1), '[ ', 'failed at #510') - call g:assert.equals(getline(2), 'foo', 'failed at #510') - call g:assert.equals(getline(3), ' ]', 'failed at #510') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #510') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #510') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #510') + call g:assert.equals(getline(1), '[ ', 'failed at #526') + call g:assert.equals(getline(2), 'foo', 'failed at #526') + call g:assert.equals(getline(3), ' ]', 'failed at #526') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #526') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #526') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #526') %delete - " #511 + " #527 call append(0, ['(aa', 'foo', 'aa)']) normal ggV2jsr[ - call g:assert.equals(getline(1), '[aa', 'failed at #511') - call g:assert.equals(getline(2), 'foo', 'failed at #511') - call g:assert.equals(getline(3), 'aa]', 'failed at #511') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #511') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #511') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #511') + call g:assert.equals(getline(1), '[aa', 'failed at #527') + call g:assert.equals(getline(2), 'foo', 'failed at #527') + call g:assert.equals(getline(3), 'aa]', 'failed at #527') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #527') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #527') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #527') %delete - " #512 + " #528 call append(0, ['(aa', 'foo', ')']) normal ggV2jsr[ - call g:assert.equals(getline(1), '[aa', 'failed at #512') - call g:assert.equals(getline(2), 'foo', 'failed at #512') - call g:assert.equals(getline(3), ']', 'failed at #512') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #512') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #512') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #512') + call g:assert.equals(getline(1), '[aa', 'failed at #528') + call g:assert.equals(getline(2), 'foo', 'failed at #528') + call g:assert.equals(getline(3), ']', 'failed at #528') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #528') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #528') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #528') %delete - " #513 + " #529 call append(0, ['(', 'foo', 'aa)']) normal ggV2jsr[ - call g:assert.equals(getline(1), '[', 'failed at #513') - call g:assert.equals(getline(2), 'foo', 'failed at #513') - call g:assert.equals(getline(3), 'aa]', 'failed at #513') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #513') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #513') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #513') + call g:assert.equals(getline(1), '[', 'failed at #529') + call g:assert.equals(getline(2), 'foo', 'failed at #529') + call g:assert.equals(getline(3), 'aa]', 'failed at #529') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #529') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #529') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #529') %delete call operator#sandwich#set('replace', 'line', 'linewise', 2) """ 2 - " #514 + " #530 call append(0, ['(', 'foo', ')']) normal ggV2jsr[ - call g:assert.equals(getline(1), '[', 'failed at #514') - call g:assert.equals(getline(2), 'foo', 'failed at #514') - call g:assert.equals(getline(3), ']', 'failed at #514') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #514') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #514') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #514') + call g:assert.equals(getline(1), '[', 'failed at #530') + call g:assert.equals(getline(2), 'foo', 'failed at #530') + call g:assert.equals(getline(3), ']', 'failed at #530') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #530') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #530') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #530') %delete - " #515 + " #531 call append(0, ['( ', 'foo', ' )']) normal ggV2jsr[ - call g:assert.equals(getline(1), '[', 'failed at #515') - call g:assert.equals(getline(2), 'foo', 'failed at #515') - call g:assert.equals(getline(3), ']', 'failed at #515') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #515') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #515') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #515') + call g:assert.equals(getline(1), '[', 'failed at #531') + call g:assert.equals(getline(2), 'foo', 'failed at #531') + call g:assert.equals(getline(3), ']', 'failed at #531') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #531') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #531') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #531') %delete - " #516 + " #532 call append(0, ['(aa', 'foo', 'aa)']) normal ggV2jsr[ - call g:assert.equals(getline(1), '[', 'failed at #516') - call g:assert.equals(getline(2), 'foo', 'failed at #516') - call g:assert.equals(getline(3), ']', 'failed at #516') - call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #516') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #516') - call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #516') + call g:assert.equals(getline(1), '[', 'failed at #532') + call g:assert.equals(getline(2), 'foo', 'failed at #532') + call g:assert.equals(getline(3), ']', 'failed at #532') + call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #532') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #532') + call g:assert.equals(getpos("']"), [0, 3, 2, 0], 'failed at #532') %delete - " #517 + " #533 " FIXME: I have no idea what is the expexted behavior. call append(0, ['aa', '(foo)', 'bb']) normal ggjVsr[ - call g:assert.equals(getline(1), 'aa', 'failed at #517') - call g:assert.equals(getline(2), '[', 'failed at #517') - call g:assert.equals(getline(3), 'bb', 'failed at #517') - call g:assert.equals(getline(4), '', 'failed at #517') - call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #517') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #517') - call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #517') + call g:assert.equals(getline(1), 'aa', 'failed at #533') + call g:assert.equals(getline(2), '[', 'failed at #533') + call g:assert.equals(getline(3), 'bb', 'failed at #533') + call g:assert.equals(getline(4), '', 'failed at #533') + call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #533') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #533') + call g:assert.equals(getpos("']"), [0, 3, 1, 0], 'failed at #533') endfunction "}}} function! s:suite.linewise_x_option_query_once() abort "{{{ @@ -6327,19 +6415,19 @@ function! s:suite.linewise_x_option_query_once() abort "{{{ """"" query_once """ off - " #518 + " #534 call setline('.', '"""foo"""') normal V3sr([{ - call g:assert.equals(getline('.'), '([{foo}])', 'failed at #518') + call g:assert.equals(getline('.'), '([{foo}])', 'failed at #534') %delete """ on - " #519 + " #535 call operator#sandwich#set('replace', 'line', 'query_once', 1) call setline('.', '"""foo"""') normal V3sr( - call g:assert.equals(getline('.'), '(((foo)))', 'failed at #519') + call g:assert.equals(getline('.'), '(((foo)))', 'failed at #535') call operator#sandwich#set('replace', 'line', 'query_once', 0) endfunction @@ -6351,17 +6439,17 @@ function! s:suite.linewise_x_option_expr() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['1+1', '1+2'], 'input':['a']}] """ 0 - " #520 + " #536 call setline('.', '"foo"') normal Vsra - call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #520') + call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #536') """ 1 - " #521 + " #537 call operator#sandwich#set('replace', 'line', 'expr', 1) call setline('.', '"foo"') normal Vsra - call g:assert.equals(getline('.'), '2foo3', 'failed at #521') + call g:assert.equals(getline('.'), '2foo3', 'failed at #537') """ 2 " This case cannot be tested since this option makes difference only in @@ -6386,430 +6474,57 @@ function! s:suite.linewise_x_option_autoindent() abort "{{{ """ -1 call operator#sandwich#set('replace', 'line', 'autoindent', -1) - " #522 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #522') - call g:assert.equals(getline(2), '[', 'failed at #522') - call g:assert.equals(getline(3), '', 'failed at #522') - call g:assert.equals(getline(4), ' foo', 'failed at #522') - call g:assert.equals(getline(5), '', 'failed at #522') - call g:assert.equals(getline(6), ']', 'failed at #522') - call g:assert.equals(getline(7), '}', 'failed at #522') - " call g:assert.equals(getpos('.'), [0, 4, 5, 0], 'failed at #522') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #522') - " call g:assert.equals(getpos("']"), [0, 7, 2, 0], 'failed at #522') - call g:assert.equals(&l:autoindent, 0, 'failed at #522') - call g:assert.equals(&l:smartindent, 0, 'failed at #522') - call g:assert.equals(&l:cindent, 0, 'failed at #522') - call g:assert.equals(&l:indentexpr, '', 'failed at #522') - - %delete - - " #523 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #523') - call g:assert.equals(getline(2), ' [', 'failed at #523') - call g:assert.equals(getline(3), '', 'failed at #523') - call g:assert.equals(getline(4), ' foo', 'failed at #523') - call g:assert.equals(getline(5), '', 'failed at #523') - call g:assert.equals(getline(6), ' ]', 'failed at #523') - call g:assert.equals(getline(7), ' }', 'failed at #523') - " call g:assert.equals(getpos('.'), [0, 4, 5, 0], 'failed at #523') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #523') - " call g:assert.equals(getpos("']"), [0, 7, 6, 0], 'failed at #523') - call g:assert.equals(&l:autoindent, 1, 'failed at #523') - call g:assert.equals(&l:smartindent, 0, 'failed at #523') - call g:assert.equals(&l:cindent, 0, 'failed at #523') - call g:assert.equals(&l:indentexpr, '', 'failed at #523') - - %delete - - " #524 - setlocal smartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #524') - call g:assert.equals(getline(2), ' [', 'failed at #524') - call g:assert.equals(getline(3), '', 'failed at #524') - call g:assert.equals(getline(4), ' foo', 'failed at #524') - call g:assert.equals(getline(5), '', 'failed at #524') - call g:assert.equals(getline(6), ' ]', 'failed at #524') - call g:assert.equals(getline(7), '}', 'failed at #524') - " call g:assert.equals(getpos('.'), [0, 4, 9, 0], 'failed at #524') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #524') - " call g:assert.equals(getpos("']"), [0, 7, 2, 0], 'failed at #524') - call g:assert.equals(&l:autoindent, 1, 'failed at #524') - call g:assert.equals(&l:smartindent, 1, 'failed at #524') - call g:assert.equals(&l:cindent, 0, 'failed at #524') - call g:assert.equals(&l:indentexpr, '', 'failed at #524') - - %delete - - " #525 - setlocal cindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #525') - call g:assert.equals(getline(2), ' [', 'failed at #525') - call g:assert.equals(getline(3), '', 'failed at #525') - call g:assert.equals(getline(4), ' foo', 'failed at #525') - call g:assert.equals(getline(5), '', 'failed at #525') - call g:assert.equals(getline(6), ' ]', 'failed at #525') - call g:assert.equals(getline(7), ' }', 'failed at #525') - " call g:assert.equals(getpos('.'), [0, 4, 9, 0], 'failed at #525') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #525') - " call g:assert.equals(getpos("']"), [0, 7, 6, 0], 'failed at #525') - call g:assert.equals(&l:autoindent, 1, 'failed at #525') - call g:assert.equals(&l:smartindent, 1, 'failed at #525') - call g:assert.equals(&l:cindent, 1, 'failed at #525') - call g:assert.equals(&l:indentexpr, '', 'failed at #525') - - %delete - - " #526 - setlocal indentexpr=TestIndent() - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #526') - call g:assert.equals(getline(2), ' [', 'failed at #526') - call g:assert.equals(getline(3), '', 'failed at #526') - call g:assert.equals(getline(4), ' foo', 'failed at #526') - call g:assert.equals(getline(5), '', 'failed at #526') - call g:assert.equals(getline(6), ' ]', 'failed at #526') - call g:assert.equals(getline(7), ' }', 'failed at #526') - " call g:assert.equals(getpos('.'), [0, 4, 17, 0], 'failed at #526') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #526') - " call g:assert.equals(getpos("']"), [0, 7, 18, 0], 'failed at #526') - call g:assert.equals(&l:autoindent, 1, 'failed at #526') - call g:assert.equals(&l:smartindent, 1, 'failed at #526') - call g:assert.equals(&l:cindent, 1, 'failed at #526') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #526') - - %delete - - """ 0 - call operator#sandwich#set('replace', 'line', 'autoindent', 0) - - " #527 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #527') - call g:assert.equals(getline(2), '[', 'failed at #527') - call g:assert.equals(getline(3), '', 'failed at #527') - call g:assert.equals(getline(4), ' foo', 'failed at #527') - call g:assert.equals(getline(5), '', 'failed at #527') - call g:assert.equals(getline(6), ']', 'failed at #527') - call g:assert.equals(getline(7), '}', 'failed at #527') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #527') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #527') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #527') - call g:assert.equals(&l:autoindent, 0, 'failed at #527') - call g:assert.equals(&l:smartindent, 0, 'failed at #527') - call g:assert.equals(&l:cindent, 0, 'failed at #527') - call g:assert.equals(&l:indentexpr, '', 'failed at #527') - - %delete - - " #528 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #528') - call g:assert.equals(getline(2), '[', 'failed at #528') - call g:assert.equals(getline(3), '', 'failed at #528') - call g:assert.equals(getline(4), ' foo', 'failed at #528') - call g:assert.equals(getline(5), '', 'failed at #528') - call g:assert.equals(getline(6), ']', 'failed at #528') - call g:assert.equals(getline(7), '}', 'failed at #528') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #528') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #528') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #528') - call g:assert.equals(&l:autoindent, 1, 'failed at #528') - call g:assert.equals(&l:smartindent, 0, 'failed at #528') - call g:assert.equals(&l:cindent, 0, 'failed at #528') - call g:assert.equals(&l:indentexpr, '', 'failed at #528') - - %delete - - " #529 - setlocal smartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #529') - call g:assert.equals(getline(2), '[', 'failed at #529') - call g:assert.equals(getline(3), '', 'failed at #529') - call g:assert.equals(getline(4), ' foo', 'failed at #529') - call g:assert.equals(getline(5), '', 'failed at #529') - call g:assert.equals(getline(6), ']', 'failed at #529') - call g:assert.equals(getline(7), '}', 'failed at #529') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #529') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #529') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #529') - call g:assert.equals(&l:autoindent, 1, 'failed at #529') - call g:assert.equals(&l:smartindent, 1, 'failed at #529') - call g:assert.equals(&l:cindent, 0, 'failed at #529') - call g:assert.equals(&l:indentexpr, '', 'failed at #529') - - %delete - - " #530 - setlocal cindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #530') - call g:assert.equals(getline(2), '[', 'failed at #530') - call g:assert.equals(getline(3), '', 'failed at #530') - call g:assert.equals(getline(4), ' foo', 'failed at #530') - call g:assert.equals(getline(5), '', 'failed at #530') - call g:assert.equals(getline(6), ']', 'failed at #530') - call g:assert.equals(getline(7), '}', 'failed at #530') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #530') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #530') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #530') - call g:assert.equals(&l:autoindent, 1, 'failed at #530') - call g:assert.equals(&l:smartindent, 1, 'failed at #530') - call g:assert.equals(&l:cindent, 1, 'failed at #530') - call g:assert.equals(&l:indentexpr, '', 'failed at #530') - - %delete - - " #531 - setlocal indentexpr=TestIndent() - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #531') - call g:assert.equals(getline(2), '[', 'failed at #531') - call g:assert.equals(getline(3), '', 'failed at #531') - call g:assert.equals(getline(4), ' foo', 'failed at #531') - call g:assert.equals(getline(5), '', 'failed at #531') - call g:assert.equals(getline(6), ']', 'failed at #531') - call g:assert.equals(getline(7), '}', 'failed at #531') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #531') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #531') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #531') - call g:assert.equals(&l:autoindent, 1, 'failed at #531') - call g:assert.equals(&l:smartindent, 1, 'failed at #531') - call g:assert.equals(&l:cindent, 1, 'failed at #531') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #531') - - %delete - - """ 1 - call operator#sandwich#set('replace', 'line', 'autoindent', 1) - - " #532 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #532') - call g:assert.equals(getline(2), ' [', 'failed at #532') - call g:assert.equals(getline(3), '', 'failed at #532') - call g:assert.equals(getline(4), ' foo', 'failed at #532') - call g:assert.equals(getline(5), '', 'failed at #532') - call g:assert.equals(getline(6), ' ]', 'failed at #532') - call g:assert.equals(getline(7), ' }', 'failed at #532') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #532') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #532') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #532') - call g:assert.equals(&l:autoindent, 0, 'failed at #532') - call g:assert.equals(&l:smartindent, 0, 'failed at #532') - call g:assert.equals(&l:cindent, 0, 'failed at #532') - call g:assert.equals(&l:indentexpr, '', 'failed at #532') - - %delete - - " #533 - setlocal autoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #533') - call g:assert.equals(getline(2), ' [', 'failed at #533') - call g:assert.equals(getline(3), '', 'failed at #533') - call g:assert.equals(getline(4), ' foo', 'failed at #533') - call g:assert.equals(getline(5), '', 'failed at #533') - call g:assert.equals(getline(6), ' ]', 'failed at #533') - call g:assert.equals(getline(7), ' }', 'failed at #533') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #533') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #533') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #533') - call g:assert.equals(&l:autoindent, 1, 'failed at #533') - call g:assert.equals(&l:smartindent, 0, 'failed at #533') - call g:assert.equals(&l:cindent, 0, 'failed at #533') - call g:assert.equals(&l:indentexpr, '', 'failed at #533') - - %delete - - " #534 - setlocal smartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #534') - call g:assert.equals(getline(2), ' [', 'failed at #534') - call g:assert.equals(getline(3), '', 'failed at #534') - call g:assert.equals(getline(4), ' foo', 'failed at #534') - call g:assert.equals(getline(5), '', 'failed at #534') - call g:assert.equals(getline(6), ' ]', 'failed at #534') - call g:assert.equals(getline(7), ' }', 'failed at #534') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #534') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #534') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #534') - call g:assert.equals(&l:autoindent, 1, 'failed at #534') - call g:assert.equals(&l:smartindent, 1, 'failed at #534') - call g:assert.equals(&l:cindent, 0, 'failed at #534') - call g:assert.equals(&l:indentexpr, '', 'failed at #534') - - %delete - - " #535 - setlocal cindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #535') - call g:assert.equals(getline(2), ' [', 'failed at #535') - call g:assert.equals(getline(3), '', 'failed at #535') - call g:assert.equals(getline(4), ' foo', 'failed at #535') - call g:assert.equals(getline(5), '', 'failed at #535') - call g:assert.equals(getline(6), ' ]', 'failed at #535') - call g:assert.equals(getline(7), ' }', 'failed at #535') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #535') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #535') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #535') - call g:assert.equals(&l:autoindent, 1, 'failed at #535') - call g:assert.equals(&l:smartindent, 1, 'failed at #535') - call g:assert.equals(&l:cindent, 1, 'failed at #535') - call g:assert.equals(&l:indentexpr, '', 'failed at #535') - - %delete - - " #536 - setlocal indentexpr=TestIndent() - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #536') - call g:assert.equals(getline(2), ' [', 'failed at #536') - call g:assert.equals(getline(3), '', 'failed at #536') - call g:assert.equals(getline(4), ' foo', 'failed at #536') - call g:assert.equals(getline(5), '', 'failed at #536') - call g:assert.equals(getline(6), ' ]', 'failed at #536') - call g:assert.equals(getline(7), ' }', 'failed at #536') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #536') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #536') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #536') - call g:assert.equals(&l:autoindent, 1, 'failed at #536') - call g:assert.equals(&l:smartindent, 1, 'failed at #536') - call g:assert.equals(&l:cindent, 1, 'failed at #536') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #536') - - %delete - - """ 2 - call operator#sandwich#set('replace', 'line', 'autoindent', 2) - - " #537 - setlocal noautoindent - setlocal nosmartindent - setlocal nocindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #537') - call g:assert.equals(getline(2), ' [', 'failed at #537') - call g:assert.equals(getline(3), '', 'failed at #537') - call g:assert.equals(getline(4), ' foo', 'failed at #537') - call g:assert.equals(getline(5), '', 'failed at #537') - call g:assert.equals(getline(6), ' ]', 'failed at #537') - call g:assert.equals(getline(7), '}', 'failed at #537') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #537') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #537') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #537') - call g:assert.equals(&l:autoindent, 0, 'failed at #537') - call g:assert.equals(&l:smartindent, 0, 'failed at #537') - call g:assert.equals(&l:cindent, 0, 'failed at #537') - call g:assert.equals(&l:indentexpr, '', 'failed at #537') - - %delete - " #538 - setlocal autoindent + setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #538') - call g:assert.equals(getline(2), ' [', 'failed at #538') - call g:assert.equals(getline(3), '', 'failed at #538') - call g:assert.equals(getline(4), ' foo', 'failed at #538') - call g:assert.equals(getline(5), '', 'failed at #538') - call g:assert.equals(getline(6), ' ]', 'failed at #538') - call g:assert.equals(getline(7), '}', 'failed at #538') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #538') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #538') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #538') - call g:assert.equals(&l:autoindent, 1, 'failed at #538') - call g:assert.equals(&l:smartindent, 0, 'failed at #538') - call g:assert.equals(&l:cindent, 0, 'failed at #538') - call g:assert.equals(&l:indentexpr, '', 'failed at #538') + call g:assert.equals(getline(1), '{', 'failed at #538') + call g:assert.equals(getline(2), '[', 'failed at #538') + call g:assert.equals(getline(3), '', 'failed at #538') + call g:assert.equals(getline(4), ' foo', 'failed at #538') + call g:assert.equals(getline(5), '', 'failed at #538') + call g:assert.equals(getline(6), ']', 'failed at #538') + call g:assert.equals(getline(7), '}', 'failed at #538') + " call g:assert.equals(getpos('.'), [0, 4, 5, 0], 'failed at #538') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #538') + " call g:assert.equals(getpos("']"), [0, 7, 2, 0], 'failed at #538') + call g:assert.equals(&l:autoindent, 0, 'failed at #538') + call g:assert.equals(&l:smartindent, 0, 'failed at #538') + call g:assert.equals(&l:cindent, 0, 'failed at #538') + call g:assert.equals(&l:indentexpr, '', 'failed at #538') %delete " #539 - setlocal smartindent + setlocal autoindent + setlocal nosmartindent setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #539') - call g:assert.equals(getline(2), ' [', 'failed at #539') - call g:assert.equals(getline(3), '', 'failed at #539') - call g:assert.equals(getline(4), ' foo', 'failed at #539') - call g:assert.equals(getline(5), '', 'failed at #539') - call g:assert.equals(getline(6), ' ]', 'failed at #539') - call g:assert.equals(getline(7), '}', 'failed at #539') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #539') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #539') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #539') - call g:assert.equals(&l:autoindent, 1, 'failed at #539') - call g:assert.equals(&l:smartindent, 1, 'failed at #539') - call g:assert.equals(&l:cindent, 0, 'failed at #539') - call g:assert.equals(&l:indentexpr, '', 'failed at #539') + call g:assert.equals(getline(1), ' {', 'failed at #539') + call g:assert.equals(getline(2), ' [', 'failed at #539') + call g:assert.equals(getline(3), '', 'failed at #539') + call g:assert.equals(getline(4), ' foo', 'failed at #539') + call g:assert.equals(getline(5), '', 'failed at #539') + call g:assert.equals(getline(6), ' ]', 'failed at #539') + call g:assert.equals(getline(7), ' }', 'failed at #539') + " call g:assert.equals(getpos('.'), [0, 4, 5, 0], 'failed at #539') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #539') + " call g:assert.equals(getpos("']"), [0, 7, 6, 0], 'failed at #539') + call g:assert.equals(&l:autoindent, 1, 'failed at #539') + call g:assert.equals(&l:smartindent, 0, 'failed at #539') + call g:assert.equals(&l:cindent, 0, 'failed at #539') + call g:assert.equals(&l:indentexpr, '', 'failed at #539') %delete " #540 - setlocal cindent + setlocal smartindent + setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggV2jsra @@ -6820,151 +6535,524 @@ function! s:suite.linewise_x_option_autoindent() abort "{{{ call g:assert.equals(getline(5), '', 'failed at #540') call g:assert.equals(getline(6), ' ]', 'failed at #540') call g:assert.equals(getline(7), '}', 'failed at #540') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #540') + " call g:assert.equals(getpos('.'), [0, 4, 9, 0], 'failed at #540') " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #540') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #540') + " call g:assert.equals(getpos("']"), [0, 7, 2, 0], 'failed at #540') call g:assert.equals(&l:autoindent, 1, 'failed at #540') call g:assert.equals(&l:smartindent, 1, 'failed at #540') - call g:assert.equals(&l:cindent, 1, 'failed at #540') + call g:assert.equals(&l:cindent, 0, 'failed at #540') call g:assert.equals(&l:indentexpr, '', 'failed at #540') %delete " #541 - setlocal indentexpr=TestIndent() + setlocal cindent + setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #541') - call g:assert.equals(getline(2), ' [', 'failed at #541') - call g:assert.equals(getline(3), '', 'failed at #541') - call g:assert.equals(getline(4), ' foo', 'failed at #541') - call g:assert.equals(getline(5), '', 'failed at #541') - call g:assert.equals(getline(6), ' ]', 'failed at #541') - call g:assert.equals(getline(7), '}', 'failed at #541') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #541') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #541') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #541') - call g:assert.equals(&l:autoindent, 1, 'failed at #541') - call g:assert.equals(&l:smartindent, 1, 'failed at #541') - call g:assert.equals(&l:cindent, 1, 'failed at #541') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #541') + call g:assert.equals(getline(1), '{', 'failed at #541') + call g:assert.equals(getline(2), ' [', 'failed at #541') + call g:assert.equals(getline(3), '', 'failed at #541') + call g:assert.equals(getline(4), ' foo', 'failed at #541') + call g:assert.equals(getline(5), '', 'failed at #541') + call g:assert.equals(getline(6), ' ]', 'failed at #541') + call g:assert.equals(getline(7), ' }', 'failed at #541') + " call g:assert.equals(getpos('.'), [0, 4, 9, 0], 'failed at #541') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #541') + " call g:assert.equals(getpos("']"), [0, 7, 6, 0], 'failed at #541') + call g:assert.equals(&l:autoindent, 1, 'failed at #541') + call g:assert.equals(&l:smartindent, 1, 'failed at #541') + call g:assert.equals(&l:cindent, 1, 'failed at #541') + call g:assert.equals(&l:indentexpr, '', 'failed at #541') %delete - """ 3 - call operator#sandwich#set('replace', 'line', 'autoindent', 3) - " #542 + setlocal indentexpr=TestIndent() + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), ' {', 'failed at #542') + call g:assert.equals(getline(2), ' [', 'failed at #542') + call g:assert.equals(getline(3), '', 'failed at #542') + call g:assert.equals(getline(4), ' foo', 'failed at #542') + call g:assert.equals(getline(5), '', 'failed at #542') + call g:assert.equals(getline(6), ' ]', 'failed at #542') + call g:assert.equals(getline(7), ' }', 'failed at #542') + " call g:assert.equals(getpos('.'), [0, 4, 17, 0], 'failed at #542') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #542') + " call g:assert.equals(getpos("']"), [0, 7, 18, 0], 'failed at #542') + call g:assert.equals(&l:autoindent, 1, 'failed at #542') + call g:assert.equals(&l:smartindent, 1, 'failed at #542') + call g:assert.equals(&l:cindent, 1, 'failed at #542') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #542') + + %delete + + """ 0 + call operator#sandwich#set('replace', 'line', 'autoindent', 0) + + " #543 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #542') - call g:assert.equals(getline(2), ' [', 'failed at #542') - call g:assert.equals(getline(3), '', 'failed at #542') - call g:assert.equals(getline(4), ' foo', 'failed at #542') - call g:assert.equals(getline(5), '', 'failed at #542') - call g:assert.equals(getline(6), ' ]', 'failed at #542') - call g:assert.equals(getline(7), ' }', 'failed at #542') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #542') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #542') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #542') - call g:assert.equals(&l:autoindent, 0, 'failed at #542') - call g:assert.equals(&l:smartindent, 0, 'failed at #542') - call g:assert.equals(&l:cindent, 0, 'failed at #542') - call g:assert.equals(&l:indentexpr, '', 'failed at #542') + call g:assert.equals(getline(1), '{', 'failed at #543') + call g:assert.equals(getline(2), '[', 'failed at #543') + call g:assert.equals(getline(3), '', 'failed at #543') + call g:assert.equals(getline(4), ' foo', 'failed at #543') + call g:assert.equals(getline(5), '', 'failed at #543') + call g:assert.equals(getline(6), ']', 'failed at #543') + call g:assert.equals(getline(7), '}', 'failed at #543') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #543') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #543') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #543') + call g:assert.equals(&l:autoindent, 0, 'failed at #543') + call g:assert.equals(&l:smartindent, 0, 'failed at #543') + call g:assert.equals(&l:cindent, 0, 'failed at #543') + call g:assert.equals(&l:indentexpr, '', 'failed at #543') %delete - " #543 + " #544 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #543') - call g:assert.equals(getline(2), ' [', 'failed at #543') - call g:assert.equals(getline(3), '', 'failed at #543') - call g:assert.equals(getline(4), ' foo', 'failed at #543') - call g:assert.equals(getline(5), '', 'failed at #543') - call g:assert.equals(getline(6), ' ]', 'failed at #543') - call g:assert.equals(getline(7), ' }', 'failed at #543') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #543') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #543') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #543') - call g:assert.equals(&l:autoindent, 1, 'failed at #543') - call g:assert.equals(&l:smartindent, 0, 'failed at #543') - call g:assert.equals(&l:cindent, 0, 'failed at #543') - call g:assert.equals(&l:indentexpr, '', 'failed at #543') + call g:assert.equals(getline(1), '{', 'failed at #544') + call g:assert.equals(getline(2), '[', 'failed at #544') + call g:assert.equals(getline(3), '', 'failed at #544') + call g:assert.equals(getline(4), ' foo', 'failed at #544') + call g:assert.equals(getline(5), '', 'failed at #544') + call g:assert.equals(getline(6), ']', 'failed at #544') + call g:assert.equals(getline(7), '}', 'failed at #544') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #544') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #544') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #544') + call g:assert.equals(&l:autoindent, 1, 'failed at #544') + call g:assert.equals(&l:smartindent, 0, 'failed at #544') + call g:assert.equals(&l:cindent, 0, 'failed at #544') + call g:assert.equals(&l:indentexpr, '', 'failed at #544') %delete - " #544 + " #545 setlocal smartindent setlocal nocindent setlocal indentexpr= call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #544') - call g:assert.equals(getline(2), ' [', 'failed at #544') - call g:assert.equals(getline(3), '', 'failed at #544') - call g:assert.equals(getline(4), ' foo', 'failed at #544') - call g:assert.equals(getline(5), '', 'failed at #544') - call g:assert.equals(getline(6), ' ]', 'failed at #544') - call g:assert.equals(getline(7), ' }', 'failed at #544') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #544') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #544') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #544') - call g:assert.equals(&l:autoindent, 1, 'failed at #544') - call g:assert.equals(&l:smartindent, 1, 'failed at #544') - call g:assert.equals(&l:cindent, 0, 'failed at #544') - call g:assert.equals(&l:indentexpr, '', 'failed at #544') - - %delete - - " #545 - setlocal cindent - setlocal indentexpr= - call append(0, [' "', ' foo', ' "']) - normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #545') - call g:assert.equals(getline(2), ' [', 'failed at #545') - call g:assert.equals(getline(3), '', 'failed at #545') - call g:assert.equals(getline(4), ' foo', 'failed at #545') - call g:assert.equals(getline(5), '', 'failed at #545') - call g:assert.equals(getline(6), ' ]', 'failed at #545') - call g:assert.equals(getline(7), ' }', 'failed at #545') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #545') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #545') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #545') - call g:assert.equals(&l:autoindent, 1, 'failed at #545') - call g:assert.equals(&l:smartindent, 1, 'failed at #545') - call g:assert.equals(&l:cindent, 1, 'failed at #545') - call g:assert.equals(&l:indentexpr, '', 'failed at #545') + call g:assert.equals(getline(1), '{', 'failed at #545') + call g:assert.equals(getline(2), '[', 'failed at #545') + call g:assert.equals(getline(3), '', 'failed at #545') + call g:assert.equals(getline(4), ' foo', 'failed at #545') + call g:assert.equals(getline(5), '', 'failed at #545') + call g:assert.equals(getline(6), ']', 'failed at #545') + call g:assert.equals(getline(7), '}', 'failed at #545') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #545') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #545') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #545') + call g:assert.equals(&l:autoindent, 1, 'failed at #545') + call g:assert.equals(&l:smartindent, 1, 'failed at #545') + call g:assert.equals(&l:cindent, 0, 'failed at #545') + call g:assert.equals(&l:indentexpr, '', 'failed at #545') %delete " #546 + setlocal cindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #546') + call g:assert.equals(getline(2), '[', 'failed at #546') + call g:assert.equals(getline(3), '', 'failed at #546') + call g:assert.equals(getline(4), ' foo', 'failed at #546') + call g:assert.equals(getline(5), '', 'failed at #546') + call g:assert.equals(getline(6), ']', 'failed at #546') + call g:assert.equals(getline(7), '}', 'failed at #546') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #546') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #546') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #546') + call g:assert.equals(&l:autoindent, 1, 'failed at #546') + call g:assert.equals(&l:smartindent, 1, 'failed at #546') + call g:assert.equals(&l:cindent, 1, 'failed at #546') + call g:assert.equals(&l:indentexpr, '', 'failed at #546') + + %delete + + " #547 setlocal indentexpr=TestIndent() call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #546') - call g:assert.equals(getline(2), ' [', 'failed at #546') - call g:assert.equals(getline(3), '', 'failed at #546') - call g:assert.equals(getline(4), ' foo', 'failed at #546') - call g:assert.equals(getline(5), '', 'failed at #546') - call g:assert.equals(getline(6), ' ]', 'failed at #546') - call g:assert.equals(getline(7), ' }', 'failed at #546') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #546') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #546') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #546') - call g:assert.equals(&l:autoindent, 1, 'failed at #546') - call g:assert.equals(&l:smartindent, 1, 'failed at #546') - call g:assert.equals(&l:cindent, 1, 'failed at #546') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #546') + call g:assert.equals(getline(1), '{', 'failed at #547') + call g:assert.equals(getline(2), '[', 'failed at #547') + call g:assert.equals(getline(3), '', 'failed at #547') + call g:assert.equals(getline(4), ' foo', 'failed at #547') + call g:assert.equals(getline(5), '', 'failed at #547') + call g:assert.equals(getline(6), ']', 'failed at #547') + call g:assert.equals(getline(7), '}', 'failed at #547') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #547') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #547') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #547') + call g:assert.equals(&l:autoindent, 1, 'failed at #547') + call g:assert.equals(&l:smartindent, 1, 'failed at #547') + call g:assert.equals(&l:cindent, 1, 'failed at #547') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #547') + + %delete + + """ 1 + call operator#sandwich#set('replace', 'line', 'autoindent', 1) + + " #548 + setlocal noautoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), ' {', 'failed at #548') + call g:assert.equals(getline(2), ' [', 'failed at #548') + call g:assert.equals(getline(3), '', 'failed at #548') + call g:assert.equals(getline(4), ' foo', 'failed at #548') + call g:assert.equals(getline(5), '', 'failed at #548') + call g:assert.equals(getline(6), ' ]', 'failed at #548') + call g:assert.equals(getline(7), ' }', 'failed at #548') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #548') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #548') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #548') + call g:assert.equals(&l:autoindent, 0, 'failed at #548') + call g:assert.equals(&l:smartindent, 0, 'failed at #548') + call g:assert.equals(&l:cindent, 0, 'failed at #548') + call g:assert.equals(&l:indentexpr, '', 'failed at #548') + + %delete + + " #549 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), ' {', 'failed at #549') + call g:assert.equals(getline(2), ' [', 'failed at #549') + call g:assert.equals(getline(3), '', 'failed at #549') + call g:assert.equals(getline(4), ' foo', 'failed at #549') + call g:assert.equals(getline(5), '', 'failed at #549') + call g:assert.equals(getline(6), ' ]', 'failed at #549') + call g:assert.equals(getline(7), ' }', 'failed at #549') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #549') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #549') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #549') + call g:assert.equals(&l:autoindent, 1, 'failed at #549') + call g:assert.equals(&l:smartindent, 0, 'failed at #549') + call g:assert.equals(&l:cindent, 0, 'failed at #549') + call g:assert.equals(&l:indentexpr, '', 'failed at #549') + + %delete + + " #550 + setlocal smartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), ' {', 'failed at #550') + call g:assert.equals(getline(2), ' [', 'failed at #550') + call g:assert.equals(getline(3), '', 'failed at #550') + call g:assert.equals(getline(4), ' foo', 'failed at #550') + call g:assert.equals(getline(5), '', 'failed at #550') + call g:assert.equals(getline(6), ' ]', 'failed at #550') + call g:assert.equals(getline(7), ' }', 'failed at #550') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #550') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #550') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #550') + call g:assert.equals(&l:autoindent, 1, 'failed at #550') + call g:assert.equals(&l:smartindent, 1, 'failed at #550') + call g:assert.equals(&l:cindent, 0, 'failed at #550') + call g:assert.equals(&l:indentexpr, '', 'failed at #550') + + %delete + + " #551 + setlocal cindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), ' {', 'failed at #551') + call g:assert.equals(getline(2), ' [', 'failed at #551') + call g:assert.equals(getline(3), '', 'failed at #551') + call g:assert.equals(getline(4), ' foo', 'failed at #551') + call g:assert.equals(getline(5), '', 'failed at #551') + call g:assert.equals(getline(6), ' ]', 'failed at #551') + call g:assert.equals(getline(7), ' }', 'failed at #551') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #551') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #551') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #551') + call g:assert.equals(&l:autoindent, 1, 'failed at #551') + call g:assert.equals(&l:smartindent, 1, 'failed at #551') + call g:assert.equals(&l:cindent, 1, 'failed at #551') + call g:assert.equals(&l:indentexpr, '', 'failed at #551') + + %delete + + " #552 + setlocal indentexpr=TestIndent() + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), ' {', 'failed at #552') + call g:assert.equals(getline(2), ' [', 'failed at #552') + call g:assert.equals(getline(3), '', 'failed at #552') + call g:assert.equals(getline(4), ' foo', 'failed at #552') + call g:assert.equals(getline(5), '', 'failed at #552') + call g:assert.equals(getline(6), ' ]', 'failed at #552') + call g:assert.equals(getline(7), ' }', 'failed at #552') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #552') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #552') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #552') + call g:assert.equals(&l:autoindent, 1, 'failed at #552') + call g:assert.equals(&l:smartindent, 1, 'failed at #552') + call g:assert.equals(&l:cindent, 1, 'failed at #552') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #552') + + %delete + + """ 2 + call operator#sandwich#set('replace', 'line', 'autoindent', 2) + + " #553 + setlocal noautoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #553') + call g:assert.equals(getline(2), ' [', 'failed at #553') + call g:assert.equals(getline(3), '', 'failed at #553') + call g:assert.equals(getline(4), ' foo', 'failed at #553') + call g:assert.equals(getline(5), '', 'failed at #553') + call g:assert.equals(getline(6), ' ]', 'failed at #553') + call g:assert.equals(getline(7), '}', 'failed at #553') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #553') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #553') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #553') + call g:assert.equals(&l:autoindent, 0, 'failed at #553') + call g:assert.equals(&l:smartindent, 0, 'failed at #553') + call g:assert.equals(&l:cindent, 0, 'failed at #553') + call g:assert.equals(&l:indentexpr, '', 'failed at #553') + + %delete + + " #554 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #554') + call g:assert.equals(getline(2), ' [', 'failed at #554') + call g:assert.equals(getline(3), '', 'failed at #554') + call g:assert.equals(getline(4), ' foo', 'failed at #554') + call g:assert.equals(getline(5), '', 'failed at #554') + call g:assert.equals(getline(6), ' ]', 'failed at #554') + call g:assert.equals(getline(7), '}', 'failed at #554') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #554') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #554') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #554') + call g:assert.equals(&l:autoindent, 1, 'failed at #554') + call g:assert.equals(&l:smartindent, 0, 'failed at #554') + call g:assert.equals(&l:cindent, 0, 'failed at #554') + call g:assert.equals(&l:indentexpr, '', 'failed at #554') + + %delete + + " #555 + setlocal smartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #555') + call g:assert.equals(getline(2), ' [', 'failed at #555') + call g:assert.equals(getline(3), '', 'failed at #555') + call g:assert.equals(getline(4), ' foo', 'failed at #555') + call g:assert.equals(getline(5), '', 'failed at #555') + call g:assert.equals(getline(6), ' ]', 'failed at #555') + call g:assert.equals(getline(7), '}', 'failed at #555') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #555') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #555') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #555') + call g:assert.equals(&l:autoindent, 1, 'failed at #555') + call g:assert.equals(&l:smartindent, 1, 'failed at #555') + call g:assert.equals(&l:cindent, 0, 'failed at #555') + call g:assert.equals(&l:indentexpr, '', 'failed at #555') + + %delete + + " #556 + setlocal cindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #556') + call g:assert.equals(getline(2), ' [', 'failed at #556') + call g:assert.equals(getline(3), '', 'failed at #556') + call g:assert.equals(getline(4), ' foo', 'failed at #556') + call g:assert.equals(getline(5), '', 'failed at #556') + call g:assert.equals(getline(6), ' ]', 'failed at #556') + call g:assert.equals(getline(7), '}', 'failed at #556') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #556') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #556') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #556') + call g:assert.equals(&l:autoindent, 1, 'failed at #556') + call g:assert.equals(&l:smartindent, 1, 'failed at #556') + call g:assert.equals(&l:cindent, 1, 'failed at #556') + call g:assert.equals(&l:indentexpr, '', 'failed at #556') + + %delete + + " #557 + setlocal indentexpr=TestIndent() + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #557') + call g:assert.equals(getline(2), ' [', 'failed at #557') + call g:assert.equals(getline(3), '', 'failed at #557') + call g:assert.equals(getline(4), ' foo', 'failed at #557') + call g:assert.equals(getline(5), '', 'failed at #557') + call g:assert.equals(getline(6), ' ]', 'failed at #557') + call g:assert.equals(getline(7), '}', 'failed at #557') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #557') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #557') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #557') + call g:assert.equals(&l:autoindent, 1, 'failed at #557') + call g:assert.equals(&l:smartindent, 1, 'failed at #557') + call g:assert.equals(&l:cindent, 1, 'failed at #557') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #557') + + %delete + + """ 3 + call operator#sandwich#set('replace', 'line', 'autoindent', 3) + + " #558 + setlocal noautoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #558') + call g:assert.equals(getline(2), ' [', 'failed at #558') + call g:assert.equals(getline(3), '', 'failed at #558') + call g:assert.equals(getline(4), ' foo', 'failed at #558') + call g:assert.equals(getline(5), '', 'failed at #558') + call g:assert.equals(getline(6), ' ]', 'failed at #558') + call g:assert.equals(getline(7), ' }', 'failed at #558') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #558') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #558') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #558') + call g:assert.equals(&l:autoindent, 0, 'failed at #558') + call g:assert.equals(&l:smartindent, 0, 'failed at #558') + call g:assert.equals(&l:cindent, 0, 'failed at #558') + call g:assert.equals(&l:indentexpr, '', 'failed at #558') + + %delete + + " #559 + setlocal autoindent + setlocal nosmartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #559') + call g:assert.equals(getline(2), ' [', 'failed at #559') + call g:assert.equals(getline(3), '', 'failed at #559') + call g:assert.equals(getline(4), ' foo', 'failed at #559') + call g:assert.equals(getline(5), '', 'failed at #559') + call g:assert.equals(getline(6), ' ]', 'failed at #559') + call g:assert.equals(getline(7), ' }', 'failed at #559') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #559') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #559') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #559') + call g:assert.equals(&l:autoindent, 1, 'failed at #559') + call g:assert.equals(&l:smartindent, 0, 'failed at #559') + call g:assert.equals(&l:cindent, 0, 'failed at #559') + call g:assert.equals(&l:indentexpr, '', 'failed at #559') + + %delete + + " #560 + setlocal smartindent + setlocal nocindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #560') + call g:assert.equals(getline(2), ' [', 'failed at #560') + call g:assert.equals(getline(3), '', 'failed at #560') + call g:assert.equals(getline(4), ' foo', 'failed at #560') + call g:assert.equals(getline(5), '', 'failed at #560') + call g:assert.equals(getline(6), ' ]', 'failed at #560') + call g:assert.equals(getline(7), ' }', 'failed at #560') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #560') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #560') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #560') + call g:assert.equals(&l:autoindent, 1, 'failed at #560') + call g:assert.equals(&l:smartindent, 1, 'failed at #560') + call g:assert.equals(&l:cindent, 0, 'failed at #560') + call g:assert.equals(&l:indentexpr, '', 'failed at #560') + + %delete + + " #561 + setlocal cindent + setlocal indentexpr= + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #561') + call g:assert.equals(getline(2), ' [', 'failed at #561') + call g:assert.equals(getline(3), '', 'failed at #561') + call g:assert.equals(getline(4), ' foo', 'failed at #561') + call g:assert.equals(getline(5), '', 'failed at #561') + call g:assert.equals(getline(6), ' ]', 'failed at #561') + call g:assert.equals(getline(7), ' }', 'failed at #561') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #561') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #561') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #561') + call g:assert.equals(&l:autoindent, 1, 'failed at #561') + call g:assert.equals(&l:smartindent, 1, 'failed at #561') + call g:assert.equals(&l:cindent, 1, 'failed at #561') + call g:assert.equals(&l:indentexpr, '', 'failed at #561') + + %delete + + " #562 + setlocal indentexpr=TestIndent() + call append(0, [' "', ' foo', ' "']) + normal ggV2jsra + call g:assert.equals(getline(1), '{', 'failed at #562') + call g:assert.equals(getline(2), ' [', 'failed at #562') + call g:assert.equals(getline(3), '', 'failed at #562') + call g:assert.equals(getline(4), ' foo', 'failed at #562') + call g:assert.equals(getline(5), '', 'failed at #562') + call g:assert.equals(getline(6), ' ]', 'failed at #562') + call g:assert.equals(getline(7), ' }', 'failed at #562') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #562') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #562') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #562') + call g:assert.equals(&l:autoindent, 1, 'failed at #562') + call g:assert.equals(&l:smartindent, 1, 'failed at #562') + call g:assert.equals(&l:cindent, 1, 'failed at #562') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #562') endfunction "}}} function! s:suite.linewise_x_option_indentkeys() abort "{{{ @@ -6980,7 +7068,7 @@ function! s:suite.linewise_x_option_indentkeys() abort "{{{ """ cinkeys call operator#sandwich#set('replace', 'line', 'autoindent', 3) - " #547 + " #563 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -6988,23 +7076,23 @@ function! s:suite.linewise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys', '0{,0},0),:,0#,!^F,e') call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #547') - call g:assert.equals(getline(2), '', 'failed at #547') - call g:assert.equals(getline(3), ' foo', 'failed at #547') - call g:assert.equals(getline(4), '', 'failed at #547') - call g:assert.equals(getline(5), ' }', 'failed at #547') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #547') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #547') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #547') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #547') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #547') + call g:assert.equals(getline(1), '{', 'failed at #563') + call g:assert.equals(getline(2), '', 'failed at #563') + call g:assert.equals(getline(3), ' foo', 'failed at #563') + call g:assert.equals(getline(4), '', 'failed at #563') + call g:assert.equals(getline(5), ' }', 'failed at #563') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #563') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #563') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #563') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #563') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #563') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', 3) - " #548 + " #564 setlocal cinkeys=0{,0},0),:,0#,!^F,e setlocal indentkeys& let cinkeys = &l:cinkeys @@ -7012,23 +7100,23 @@ function! s:suite.linewise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys+', 'O,o') call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #548') - call g:assert.equals(getline(2), '', 'failed at #548') - call g:assert.equals(getline(3), ' foo', 'failed at #548') - call g:assert.equals(getline(4), '', 'failed at #548') - call g:assert.equals(getline(5), ' }', 'failed at #548') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #548') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #548') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #548') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #548') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #548') + call g:assert.equals(getline(1), '{', 'failed at #564') + call g:assert.equals(getline(2), '', 'failed at #564') + call g:assert.equals(getline(3), ' foo', 'failed at #564') + call g:assert.equals(getline(4), '', 'failed at #564') + call g:assert.equals(getline(5), ' }', 'failed at #564') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #564') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #564') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #564') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #564') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #564') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', 3) - " #549 + " #565 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -7036,16 +7124,16 @@ function! s:suite.linewise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys-', 'O,o') call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), '{', 'failed at #549') - call g:assert.equals(getline(2), '', 'failed at #549') - call g:assert.equals(getline(3), ' foo', 'failed at #549') - call g:assert.equals(getline(4), '', 'failed at #549') - call g:assert.equals(getline(5), ' }', 'failed at #549') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #549') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #549') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #549') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #549') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #549') + call g:assert.equals(getline(1), '{', 'failed at #565') + call g:assert.equals(getline(2), '', 'failed at #565') + call g:assert.equals(getline(3), ' foo', 'failed at #565') + call g:assert.equals(getline(4), '', 'failed at #565') + call g:assert.equals(getline(5), ' }', 'failed at #565') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #565') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #565') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #565') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #565') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #565') %delete call operator#sandwich#set_default() @@ -7055,7 +7143,7 @@ function! s:suite.linewise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', -1) - " #550 + " #566 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -7063,23 +7151,23 @@ function! s:suite.linewise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys', '0{,0},0),:,0#,!^F,e') call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #550') - call g:assert.equals(getline(2), '', 'failed at #550') - call g:assert.equals(getline(3), ' foo', 'failed at #550') - call g:assert.equals(getline(4), '', 'failed at #550') - call g:assert.equals(getline(5), ' }', 'failed at #550') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #550') - " call g:assert.equals(getpos("'["), [0, 1, 8, 0], 'failed at #550') - " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #550') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #550') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #550') + call g:assert.equals(getline(1), ' {', 'failed at #566') + call g:assert.equals(getline(2), '', 'failed at #566') + call g:assert.equals(getline(3), ' foo', 'failed at #566') + call g:assert.equals(getline(4), '', 'failed at #566') + call g:assert.equals(getline(5), ' }', 'failed at #566') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #566') + " call g:assert.equals(getpos("'["), [0, 1, 8, 0], 'failed at #566') + " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #566') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #566') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #566') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', -1) - " #551 + " #567 setlocal cinkeys& setlocal indentkeys=0{,0},0),:,0#,!^F,e let cinkeys = &l:cinkeys @@ -7087,23 +7175,23 @@ function! s:suite.linewise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys+', 'O,o') call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #551') - call g:assert.equals(getline(2), '', 'failed at #551') - call g:assert.equals(getline(3), ' foo', 'failed at #551') - call g:assert.equals(getline(4), '', 'failed at #551') - call g:assert.equals(getline(5), ' }', 'failed at #551') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #551') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #551') - " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #551') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #551') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #551') + call g:assert.equals(getline(1), ' {', 'failed at #567') + call g:assert.equals(getline(2), '', 'failed at #567') + call g:assert.equals(getline(3), ' foo', 'failed at #567') + call g:assert.equals(getline(4), '', 'failed at #567') + call g:assert.equals(getline(5), ' }', 'failed at #567') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #567') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #567') + " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #567') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #567') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #567') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'line', 'linewise', 2) call operator#sandwich#set('replace', 'line', 'autoindent', -1) - " #552 + " #568 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -7111,16 +7199,16 @@ function! s:suite.linewise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'line', 'indentkeys-', 'O,o') call append(0, [' "', ' foo', ' "']) normal ggV2jsra - call g:assert.equals(getline(1), ' {', 'failed at #552') - call g:assert.equals(getline(2), '', 'failed at #552') - call g:assert.equals(getline(3), ' foo', 'failed at #552') - call g:assert.equals(getline(4), '', 'failed at #552') - call g:assert.equals(getline(5), ' }', 'failed at #552') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #552') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #552') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #552') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #552') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #552') + call g:assert.equals(getline(1), ' {', 'failed at #568') + call g:assert.equals(getline(2), '', 'failed at #568') + call g:assert.equals(getline(3), ' foo', 'failed at #568') + call g:assert.equals(getline(4), '', 'failed at #568') + call g:assert.equals(getline(5), ' }', 'failed at #568') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #568') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #568') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #568') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #568') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #568') endfunction "}}} @@ -7128,51 +7216,51 @@ endfunction function! s:suite.blockwise_n_default_recipes() abort "{{{ set whichwrap=h,l - " #553 + " #569 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal ggsr\17l[" - call g:assert.equals(getline(1), '[foo]', 'failed at #553') - call g:assert.equals(getline(2), '[bar]', 'failed at #553') - call g:assert.equals(getline(3), '[baz]', 'failed at #553') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #553') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #553') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #553') + call g:assert.equals(getline(1), '[foo]', 'failed at #569') + call g:assert.equals(getline(2), '[bar]', 'failed at #569') + call g:assert.equals(getline(3), '[baz]', 'failed at #569') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #569') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #569') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #569') %delete - " #554 + " #570 call append(0, ['[foo]', '[bar]', '[baz]']) execute "normal ggsr\17l{" - call g:assert.equals(getline(1), '{foo}', 'failed at #554') - call g:assert.equals(getline(2), '{bar}', 'failed at #554') - call g:assert.equals(getline(3), '{baz}', 'failed at #554') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #554') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #554') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #554') + call g:assert.equals(getline(1), '{foo}', 'failed at #570') + call g:assert.equals(getline(2), '{bar}', 'failed at #570') + call g:assert.equals(getline(3), '{baz}', 'failed at #570') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #570') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #570') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #570') %delete - " #555 + " #571 call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal ggsr\17l<" - call g:assert.equals(getline(1), '', 'failed at #555') - call g:assert.equals(getline(2), '', 'failed at #555') - call g:assert.equals(getline(3), '', 'failed at #555') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #555') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #555') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #555') + call g:assert.equals(getline(1), '', 'failed at #571') + call g:assert.equals(getline(2), '', 'failed at #571') + call g:assert.equals(getline(3), '', 'failed at #571') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #571') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #571') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #571') %delete - " #556 + " #572 call append(0, ['', '', '']) execute "normal ggsr\17l(" - call g:assert.equals(getline(1), '(foo)', 'failed at #556') - call g:assert.equals(getline(2), '(bar)', 'failed at #556') - call g:assert.equals(getline(3), '(baz)', 'failed at #556') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #556') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #556') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #556') + call g:assert.equals(getline(1), '(foo)', 'failed at #572') + call g:assert.equals(getline(2), '(bar)', 'failed at #572') + call g:assert.equals(getline(3), '(baz)', 'failed at #572') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #572') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #572') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #572') set whichwrap& endfunction @@ -7180,25 +7268,25 @@ endfunction function! s:suite.blockwise_n_not_registered() abort "{{{ set whichwrap=h,l - " #557 + " #573 call append(0, ['afooa', 'abara', 'abaza']) execute "normal ggsr\17lb" - call g:assert.equals(getline(1), 'bfoob', 'failed at #557') - call g:assert.equals(getline(2), 'bbarb', 'failed at #557') - call g:assert.equals(getline(3), 'bbazb', 'failed at #557') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #557') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #557') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #557') + call g:assert.equals(getline(1), 'bfoob', 'failed at #573') + call g:assert.equals(getline(2), 'bbarb', 'failed at #573') + call g:assert.equals(getline(3), 'bbazb', 'failed at #573') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #573') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #573') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #573') - " #558 + " #574 call append(0, ['+foo+', '+bar+', '+baz+']) execute "normal ggsr\17l*" - call g:assert.equals(getline(1), '*foo*', 'failed at #558') - call g:assert.equals(getline(2), '*bar*', 'failed at #558') - call g:assert.equals(getline(3), '*baz*', 'failed at #558') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #558') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #558') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #558') + call g:assert.equals(getline(1), '*foo*', 'failed at #574') + call g:assert.equals(getline(2), '*bar*', 'failed at #574') + call g:assert.equals(getline(3), '*baz*', 'failed at #574') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #574') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #574') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #574') set whichwrap& endfunction @@ -7206,99 +7294,99 @@ endfunction function! s:suite.blockwise_n_positioning() abort "{{{ set whichwrap=h,l - " #559 + " #575 call append(0, ['(foo)bar', '(foo)bar', '(foo)bar']) execute "normal ggsr\23l[" - call g:assert.equals(getline(1), '[foo]bar', 'failed at #559') - call g:assert.equals(getline(2), '[foo]bar', 'failed at #559') - call g:assert.equals(getline(3), '[foo]bar', 'failed at #559') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #559') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #559') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #559') + call g:assert.equals(getline(1), '[foo]bar', 'failed at #575') + call g:assert.equals(getline(2), '[foo]bar', 'failed at #575') + call g:assert.equals(getline(3), '[foo]bar', 'failed at #575') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #575') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #575') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #575') %delete - " #560 + " #576 call append(0, ['foo(bar)', 'foo(bar)', 'foo(bar)']) execute "normal gg3lsr\23l[" - call g:assert.equals(getline(1), 'foo[bar]', 'failed at #560') - call g:assert.equals(getline(2), 'foo[bar]', 'failed at #560') - call g:assert.equals(getline(3), 'foo[bar]', 'failed at #560') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #560') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #560') - call g:assert.equals(getpos("']"), [0, 3, 9, 0], 'failed at #560') + call g:assert.equals(getline(1), 'foo[bar]', 'failed at #576') + call g:assert.equals(getline(2), 'foo[bar]', 'failed at #576') + call g:assert.equals(getline(3), 'foo[bar]', 'failed at #576') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #576') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #576') + call g:assert.equals(getpos("']"), [0, 3, 9, 0], 'failed at #576') %delete - " #561 + " #577 call append(0, ['foo(bar)baz', 'foo(bar)baz', 'foo(bar)baz']) execute "normal gg3lsr\29l[" - call g:assert.equals(getline(1), 'foo[bar]baz', 'failed at #561') - call g:assert.equals(getline(2), 'foo[bar]baz', 'failed at #561') - call g:assert.equals(getline(3), 'foo[bar]baz', 'failed at #561') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #561') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #561') - call g:assert.equals(getpos("']"), [0, 3, 9, 0], 'failed at #561') + call g:assert.equals(getline(1), 'foo[bar]baz', 'failed at #577') + call g:assert.equals(getline(2), 'foo[bar]baz', 'failed at #577') + call g:assert.equals(getline(3), 'foo[bar]baz', 'failed at #577') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #577') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #577') + call g:assert.equals(getpos("']"), [0, 3, 9, 0], 'failed at #577') %delete - " #562 + " #578 call append(0, ['(foo)', '(bar)', 'bazbaz']) execute "normal ggsr\17l[" - call g:assert.equals(getline(1), '[foo]', 'failed at #562') - call g:assert.equals(getline(2), '[bar]', 'failed at #562') - call g:assert.equals(getline(3), 'bazbaz', 'failed at #562') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #562') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #562') - call g:assert.equals(getpos("']"), [0, 2, 6, 0], 'failed at #562') + call g:assert.equals(getline(1), '[foo]', 'failed at #578') + call g:assert.equals(getline(2), '[bar]', 'failed at #578') + call g:assert.equals(getline(3), 'bazbaz', 'failed at #578') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #578') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #578') + call g:assert.equals(getpos("']"), [0, 2, 6, 0], 'failed at #578') %delete - " #563 + " #579 call append(0, ['(foo)', 'barbar', '(baz)']) execute "normal ggsr\18l[" - call g:assert.equals(getline(1), '[foo]', 'failed at #563') - call g:assert.equals(getline(2), 'barbar', 'failed at #563') - call g:assert.equals(getline(3), '[baz]', 'failed at #563') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #563') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #563') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #563') + call g:assert.equals(getline(1), '[foo]', 'failed at #579') + call g:assert.equals(getline(2), 'barbar', 'failed at #579') + call g:assert.equals(getline(3), '[baz]', 'failed at #579') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #579') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #579') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #579') %delete - " #564 + " #580 call append(0, ['foofoo', '(bar)', '(baz)']) execute "normal ggsr\18l[" - call g:assert.equals(getline(1), 'foofoo', 'failed at #564') - call g:assert.equals(getline(2), '[bar]', 'failed at #564') - call g:assert.equals(getline(3), '[baz]', 'failed at #564') - call g:assert.equals(getpos('.'), [0, 2, 2, 0], 'failed at #564') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #564') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #564') + call g:assert.equals(getline(1), 'foofoo', 'failed at #580') + call g:assert.equals(getline(2), '[bar]', 'failed at #580') + call g:assert.equals(getline(3), '[baz]', 'failed at #580') + call g:assert.equals(getpos('.'), [0, 2, 2, 0], 'failed at #580') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #580') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #580') %delete - " #565 + " #581 call append(0, ['(foo)', '(baar)', '(baaz)']) execute "normal ggsr\20l[" - call g:assert.equals(getline(1), '[foo]', 'failed at #565') - call g:assert.equals(getline(2), '[baar]', 'failed at #565') - call g:assert.equals(getline(3), '[baaz]', 'failed at #565') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #565') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #565') - call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #565') + call g:assert.equals(getline(1), '[foo]', 'failed at #581') + call g:assert.equals(getline(2), '[baar]', 'failed at #581') + call g:assert.equals(getline(3), '[baaz]', 'failed at #581') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #581') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #581') + call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #581') %delete - " #566 + " #582 call append(0, ['(fooo)', '(bar)', '(baaz)']) execute "normal ggsr\20l[" - call g:assert.equals(getline(1), '[fooo]', 'failed at #566') - call g:assert.equals(getline(2), '[bar]', 'failed at #566') - call g:assert.equals(getline(3), '[baaz]', 'failed at #566') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #566') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #566') - call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #566') + call g:assert.equals(getline(1), '[fooo]', 'failed at #582') + call g:assert.equals(getline(2), '[bar]', 'failed at #582') + call g:assert.equals(getline(3), '[baaz]', 'failed at #582') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #582') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #582') + call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #582') set whichwrap& endfunction @@ -7306,15 +7394,15 @@ endfunction function! s:suite.blockwise_n_a_character() abort "{{{ set whichwrap=h,l - " #567 + " #583 call append(0, ['(a)', '(b)', '(c)']) execute "normal ggsr\11l[" - call g:assert.equals(getline(1), '[a]', 'failed at #567') - call g:assert.equals(getline(2), '[b]', 'failed at #567') - call g:assert.equals(getline(3), '[c]', 'failed at #567') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #567') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #567') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #567') + call g:assert.equals(getline(1), '[a]', 'failed at #583') + call g:assert.equals(getline(2), '[b]', 'failed at #583') + call g:assert.equals(getline(3), '[c]', 'failed at #583') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #583') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #583') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #583') set whichwrap& endfunction @@ -7322,27 +7410,27 @@ endfunction function! s:suite.blockwise_n_nothing_inside() abort "{{{ set whichwrap=h,l - " #568 + " #584 call append(0, ['()', '()', '()']) execute "normal ggsr\8l[" - call g:assert.equals(getline(1), '[]', 'failed at #568') - call g:assert.equals(getline(2), '[]', 'failed at #568') - call g:assert.equals(getline(3), '[]', 'failed at #568') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #568') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #568') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #568') + call g:assert.equals(getline(1), '[]', 'failed at #584') + call g:assert.equals(getline(2), '[]', 'failed at #584') + call g:assert.equals(getline(3), '[]', 'failed at #584') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #584') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #584') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #584') %delete - " #569 + " #585 call append(0, ['foo()bar', 'foo()bar', 'foo()bar']) execute "normal gg3lsr\20l[" - call g:assert.equals(getline(1), 'foo[]bar', 'failed at #569') - call g:assert.equals(getline(2), 'foo[]bar', 'failed at #569') - call g:assert.equals(getline(3), 'foo[]bar', 'failed at #569') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #569') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #569') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #569') + call g:assert.equals(getline(1), 'foo[]bar', 'failed at #585') + call g:assert.equals(getline(2), 'foo[]bar', 'failed at #585') + call g:assert.equals(getline(3), 'foo[]bar', 'failed at #585') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #585') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #585') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #585') set whichwrap& endfunction @@ -7350,63 +7438,63 @@ endfunction function! s:suite.blockwise_n_count() abort "{{{ set whichwrap=h,l - " #570 + " #586 call append(0, ['[(foo)]', '[(bar)]', '[(baz)]']) execute "normal gg3sr\23l({" - call g:assert.equals(getline(1), '({foo})', 'failed at #570') - call g:assert.equals(getline(2), '({bar})', 'failed at #570') - call g:assert.equals(getline(3), '({baz})', 'failed at #570') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #570') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #570') - call g:assert.equals(getpos("']"), [0, 3, 8, 0], 'failed at #570') + call g:assert.equals(getline(1), '({foo})', 'failed at #586') + call g:assert.equals(getline(2), '({bar})', 'failed at #586') + call g:assert.equals(getline(3), '({baz})', 'failed at #586') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #586') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #586') + call g:assert.equals(getpos("']"), [0, 3, 8, 0], 'failed at #586') %delete - " #571 + " #587 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal gg3sr\29l({[" - call g:assert.equals(getline(1), '({[foo]})', 'failed at #571') - call g:assert.equals(getline(2), '({[bar]})', 'failed at #571') - call g:assert.equals(getline(3), '({[baz]})', 'failed at #571') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #571') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #571') - call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #571') + call g:assert.equals(getline(1), '({[foo]})', 'failed at #587') + call g:assert.equals(getline(2), '({[bar]})', 'failed at #587') + call g:assert.equals(getline(3), '({[baz]})', 'failed at #587') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #587') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #587') + call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #587') %delete - " #572 + " #588 call append(0, ['{[afoob]}', '{[(bar)]}', '{[(baz)]}']) execute "normal gg3sr\29l({[" - call g:assert.equals(getline(1), '({afoob})', 'failed at #572') - call g:assert.equals(getline(2), '({[bar]})', 'failed at #572') - call g:assert.equals(getline(3), '({[baz]})', 'failed at #572') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #572') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #572') - call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #572') + call g:assert.equals(getline(1), '({afoob})', 'failed at #588') + call g:assert.equals(getline(2), '({[bar]})', 'failed at #588') + call g:assert.equals(getline(3), '({[baz]})', 'failed at #588') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #588') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #588') + call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #588') %delete - " #573 + " #589 call append(0, ['{[(foo)]}', '{[abarb]}', '{[(baz)]}']) execute "normal gg3sr\29l({[" - call g:assert.equals(getline(1), '({[foo]})', 'failed at #573') - call g:assert.equals(getline(2), '({abarb})', 'failed at #573') - call g:assert.equals(getline(3), '({[baz]})', 'failed at #573') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #573') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #573') - call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #573') + call g:assert.equals(getline(1), '({[foo]})', 'failed at #589') + call g:assert.equals(getline(2), '({abarb})', 'failed at #589') + call g:assert.equals(getline(3), '({[baz]})', 'failed at #589') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #589') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #589') + call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #589') %delete - " #574 + " #590 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[abazb]}']) execute "normal gg3sr\29l({[" - call g:assert.equals(getline(1), '({[foo]})', 'failed at #574') - call g:assert.equals(getline(2), '({[bar]})', 'failed at #574') - call g:assert.equals(getline(3), '({abazb})', 'failed at #574') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #574') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #574') - call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #574') + call g:assert.equals(getline(1), '({[foo]})', 'failed at #590') + call g:assert.equals(getline(2), '({[bar]})', 'failed at #590') + call g:assert.equals(getline(3), '({abazb})', 'failed at #590') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #590') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #590') + call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #590') set whichwrap& endfunction @@ -7422,39 +7510,39 @@ function! s:suite.blockwise_n_external_textobj() abort "{{{ \ {'external': ['it', 'at']}, \ ] - " #575 + " #591 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal ggsr\17l\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #575') - call g:assert.equals(getline(2), '"bar"', 'failed at #575') - call g:assert.equals(getline(3), '"baz"', 'failed at #575') + call g:assert.equals(getline(1), '"foo"', 'failed at #591') + call g:assert.equals(getline(2), '"bar"', 'failed at #591') + call g:assert.equals(getline(3), '"baz"', 'failed at #591') %delete - " #576 + " #592 call append(0, ['[foo]', '[bar]', '[baz]']) execute "normal ggsr\17l\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #576') - call g:assert.equals(getline(2), '"bar"', 'failed at #576') - call g:assert.equals(getline(3), '"baz"', 'failed at #576') + call g:assert.equals(getline(1), '"foo"', 'failed at #592') + call g:assert.equals(getline(2), '"bar"', 'failed at #592') + call g:assert.equals(getline(3), '"baz"', 'failed at #592') %delete - " #577 + " #593 call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal ggsr\17l\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #577') - call g:assert.equals(getline(2), '"bar"', 'failed at #577') - call g:assert.equals(getline(3), '"baz"', 'failed at #577') + call g:assert.equals(getline(1), '"foo"', 'failed at #593') + call g:assert.equals(getline(2), '"bar"', 'failed at #593') + call g:assert.equals(getline(3), '"baz"', 'failed at #593') %delete - " #578 + " #594 call append(0, ['foo', 'bar', 'baz']) execute "normal ggsr\56l\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #578') - call g:assert.equals(getline(2), '"bar"', 'failed at #578') - call g:assert.equals(getline(3), '"baz"', 'failed at #578') + call g:assert.equals(getline(1), '"foo"', 'failed at #594') + call g:assert.equals(getline(2), '"bar"', 'failed at #594') + call g:assert.equals(getline(3), '"baz"', 'failed at #594') set whichwrap& unlet g:sandwich#recipes @@ -7466,96 +7554,96 @@ function! s:suite.blockwise_n_option_cursor() abort "{{{ """"" cursor """ inner_head - " #579 + " #595 call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg2sr\29l[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #579') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #579') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #579') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #579') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #595') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #595') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #595') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #595') - " #580 + " #596 execute "normal sr\25l[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #580') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #580') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #580') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #580') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #596') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #596') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #596') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #596') %delete """ keep - " #581 + " #597 call operator#sandwich#set('replace', 'block', 'cursor', 'keep') call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg2sr\29l[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #581') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #581') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #581') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #581') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #597') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #597') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #597') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #597') - " #582 + " #598 execute "normal 2lsr\25l[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #582') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #582') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #582') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #582') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #598') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #598') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #598') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #598') %delete """ inner_tail - " #583 + " #599 call operator#sandwich#set('replace', 'block', 'cursor', 'inner_tail') call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg2sr\29l[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #583') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #583') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #583') - call g:assert.equals(getpos('.'), [0, 3, 7, 0], 'failed at #583') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #599') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #599') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #599') + call g:assert.equals(getpos('.'), [0, 3, 7, 0], 'failed at #599') - " #584 + " #600 execute "normal gg2lsr\25l[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #584') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #584') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #584') - call g:assert.equals(getpos('.'), [0, 3, 6, 0], 'failed at #584') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #600') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #600') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #600') + call g:assert.equals(getpos('.'), [0, 3, 6, 0], 'failed at #600') %delete """ head - " #585 + " #601 call operator#sandwich#set('replace', 'block', 'cursor', 'head') call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg2sr\29l[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #585') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #585') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #585') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #585') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #601') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #601') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #601') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #601') - " #586 + " #602 execute "normal 2lsr\25l[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #586') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #586') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #586') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #586') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #602') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #602') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #602') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #602') %delete """ tail - " #587 + " #603 call operator#sandwich#set('replace', 'block', 'cursor', 'tail') call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg2sr\29l[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #587') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #587') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #587') - call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #587') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #603') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #603') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #603') + call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #603') - " #588 + " #604 execute "normal 6h2ksr\25l[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #588') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #588') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #588') - call g:assert.equals(getpos('.'), [0, 3, 7, 0], 'failed at #588') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #604') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #604') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #604') + call g:assert.equals(getpos('.'), [0, 3, 7, 0], 'failed at #604') set whichwrap& call operator#sandwich#set('replace', 'block', 'cursor', 'inner_head') @@ -7571,41 +7659,41 @@ function! s:suite.blockwise_n_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #589 + " #605 call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal ggsr\17l\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #589') - call g:assert.equals(getline(2), '"bar"', 'failed at #589') - call g:assert.equals(getline(3), '"baz"', 'failed at #589') + call g:assert.equals(getline(1), '"foo"', 'failed at #605') + call g:assert.equals(getline(2), '"bar"', 'failed at #605') + call g:assert.equals(getline(3), '"baz"', 'failed at #605') %delete - " #590 + " #606 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal ggsr\17l\"" - call g:assert.equals(getline(1), '(foo)', 'failed at #590') - call g:assert.equals(getline(2), '(bar)', 'failed at #590') - call g:assert.equals(getline(3), '(baz)', 'failed at #590') + call g:assert.equals(getline(1), '(foo)', 'failed at #606') + call g:assert.equals(getline(2), '(bar)', 'failed at #606') + call g:assert.equals(getline(3), '(baz)', 'failed at #606') %delete """ off - " #591 + " #607 call operator#sandwich#set('replace', 'block', 'noremap', 0) call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal ggsr\17l\"" - call g:assert.equals(getline(1), '{foo}', 'failed at #591') - call g:assert.equals(getline(2), '{bar}', 'failed at #591') - call g:assert.equals(getline(3), '{baz}', 'failed at #591') + call g:assert.equals(getline(1), '{foo}', 'failed at #607') + call g:assert.equals(getline(2), '{bar}', 'failed at #607') + call g:assert.equals(getline(3), '{baz}', 'failed at #607') %delete - " #592 + " #608 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal ggsr\17l\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #592') - call g:assert.equals(getline(2), '"bar"', 'failed at #592') - call g:assert.equals(getline(3), '"baz"', 'failed at #592') + call g:assert.equals(getline(1), '"foo"', 'failed at #608') + call g:assert.equals(getline(2), '"bar"', 'failed at #608') + call g:assert.equals(getline(3), '"baz"', 'failed at #608') set whichwrap& unlet! g:sandwich#recipes @@ -7621,41 +7709,41 @@ function! s:suite.blockwise_n_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #593 + " #609 call append(0, ['\d\+foo\d\+', '\d\+bar\d\+', '\d\+baz\d\+']) execute "normal ggsr\35l\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #593') - call g:assert.equals(getline(2), '"bar"', 'failed at #593') - call g:assert.equals(getline(3), '"baz"', 'failed at #593') + call g:assert.equals(getline(1), '"foo"', 'failed at #609') + call g:assert.equals(getline(2), '"bar"', 'failed at #609') + call g:assert.equals(getline(3), '"baz"', 'failed at #609') %delete - " #594 + " #610 call append(0, ['888foo888', '888bar888', '888baz888']) execute "normal ggsr\29l\"" - call g:assert.equals(getline(1), '"88foo88"', 'failed at #594') - call g:assert.equals(getline(2), '"88bar88"', 'failed at #594') - call g:assert.equals(getline(3), '"88baz88"', 'failed at #594') + call g:assert.equals(getline(1), '"88foo88"', 'failed at #610') + call g:assert.equals(getline(2), '"88bar88"', 'failed at #610') + call g:assert.equals(getline(3), '"88baz88"', 'failed at #610') %delete """ on call operator#sandwich#set('replace', 'block', 'regex', 1) - " #595 + " #611 call append(0, ['\d\+foo\d\+', '\d\+bar\d\+', '\d\+baz\d\+']) execute "normal ggsr\35l\"" - call g:assert.equals(getline(1), '\d\+foo\d\+', 'failed at #595') - call g:assert.equals(getline(2), '\d\+bar\d\+', 'failed at #595') - call g:assert.equals(getline(3), '\d\+baz\d\+', 'failed at #595') + call g:assert.equals(getline(1), '\d\+foo\d\+', 'failed at #611') + call g:assert.equals(getline(2), '\d\+bar\d\+', 'failed at #611') + call g:assert.equals(getline(3), '\d\+baz\d\+', 'failed at #611') %delete - " #596 + " #612 call append(0, ['888foo888', '888bar888', '888baz888']) execute "normal ggsr\29l\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #596') - call g:assert.equals(getline(2), '"bar"', 'failed at #596') - call g:assert.equals(getline(3), '"baz"', 'failed at #596') + call g:assert.equals(getline(1), '"foo"', 'failed at #612') + call g:assert.equals(getline(2), '"bar"', 'failed at #612') + call g:assert.equals(getline(3), '"baz"', 'failed at #612') set whichwrap& call operator#sandwich#set('replace', 'block', 'regex', 0) @@ -7666,80 +7754,118 @@ endfunction function! s:suite.blockwise_n_option_skip_space() abort "{{{ set whichwrap=h,l - """ on - " #597 + """ 1 + " #613 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal ggsr\17l(" - call g:assert.equals(getline(1), '(foo)', 'failed at #597') - call g:assert.equals(getline(2), '(bar)', 'failed at #597') - call g:assert.equals(getline(3), '(baz)', 'failed at #597') + call g:assert.equals(getline(1), '(foo)', 'failed at #613') + call g:assert.equals(getline(2), '(bar)', 'failed at #613') + call g:assert.equals(getline(3), '(baz)', 'failed at #613') %delete - " #598 + " #614 call append(0, [' "foo"', ' "bar"', ' "baz"']) execute "normal ggsr\20l(" - call g:assert.equals(getline(1), ' (foo)', 'failed at #598') - call g:assert.equals(getline(2), ' (bar)', 'failed at #598') - call g:assert.equals(getline(3), ' (baz)', 'failed at #598') + call g:assert.equals(getline(1), ' (foo)', 'failed at #614') + call g:assert.equals(getline(2), ' (bar)', 'failed at #614') + call g:assert.equals(getline(3), ' (baz)', 'failed at #614') %delete - " #599 + " #615 call append(0, ['"foo" ', '"bar" ', '"baz" ']) execute "normal ggsr\20l(" - call g:assert.equals(getline(1), '(foo) ', 'failed at #599') - call g:assert.equals(getline(2), '(bar) ', 'failed at #599') - call g:assert.equals(getline(3), '(baz) ', 'failed at #599') + call g:assert.equals(getline(1), '(foo) ', 'failed at #615') + call g:assert.equals(getline(2), '(bar) ', 'failed at #615') + call g:assert.equals(getline(3), '(baz) ', 'failed at #615') %delete - " #600 + " #616 " do not skip! call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) execute "normal ggsr\23l(" - call g:assert.equals(getline(1), '("foo")', 'failed at #600') - call g:assert.equals(getline(2), '("bar")', 'failed at #600') - call g:assert.equals(getline(3), '("baz")', 'failed at #600') + call g:assert.equals(getline(1), '("foo")', 'failed at #616') + call g:assert.equals(getline(2), '("bar")', 'failed at #616') + call g:assert.equals(getline(3), '("baz")', 'failed at #616') %delete - """ off + """ 2 + call operator#sandwich#set('replace', 'block', 'skip_space', 2) + " #617 + call append(0, ['"foo"', '"bar"', '"baz"']) + execute "normal ggsr\17l(" + call g:assert.equals(getline(1), '(foo)', 'failed at #617') + call g:assert.equals(getline(2), '(bar)', 'failed at #617') + call g:assert.equals(getline(3), '(baz)', 'failed at #617') + + %delete + + " #618 + call append(0, [' "foo"', ' "bar"', ' "baz"']) + execute "normal ggsr\20l(" + call g:assert.equals(getline(1), ' (foo)', 'failed at #618') + call g:assert.equals(getline(2), ' (bar)', 'failed at #618') + call g:assert.equals(getline(3), ' (baz)', 'failed at #618') + + %delete + + " #619 + call append(0, ['"foo" ', '"bar" ', '"baz" ']) + execute "normal ggsr\20l(" + call g:assert.equals(getline(1), '(foo) ', 'failed at #619') + call g:assert.equals(getline(2), '(bar) ', 'failed at #619') + call g:assert.equals(getline(3), '(baz) ', 'failed at #619') + + %delete + + " #620 + call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) + execute "normal ggsr\23l(" + call g:assert.equals(getline(1), ' (foo) ', 'failed at #620') + call g:assert.equals(getline(2), ' (bar) ', 'failed at #620') + call g:assert.equals(getline(3), ' (baz) ', 'failed at #620') + + %delete + + """ 0 call operator#sandwich#set('replace', 'block', 'skip_space', 0) - " #601 + " #621 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal ggsr\17l(" - call g:assert.equals(getline(1), '(foo)', 'failed at #601') - call g:assert.equals(getline(2), '(bar)', 'failed at #601') - call g:assert.equals(getline(3), '(baz)', 'failed at #601') + call g:assert.equals(getline(1), '(foo)', 'failed at #621') + call g:assert.equals(getline(2), '(bar)', 'failed at #621') + call g:assert.equals(getline(3), '(baz)', 'failed at #621') %delete - " #602 + " #622 call append(0, [' "foo"', ' "bar"', ' "baz"']) execute "normal ggsr\20l(" - call g:assert.equals(getline(1), ' "foo"', 'failed at #602') - call g:assert.equals(getline(2), ' "bar"', 'failed at #602') - call g:assert.equals(getline(3), ' "baz"', 'failed at #602') + call g:assert.equals(getline(1), ' "foo"', 'failed at #622') + call g:assert.equals(getline(2), ' "bar"', 'failed at #622') + call g:assert.equals(getline(3), ' "baz"', 'failed at #622') %delete - " #603 + " #623 call append(0, ['"foo" ', '"bar" ', '"baz" ']) execute "normal ggsr\20l(" - call g:assert.equals(getline(1), '"foo" ', 'failed at #603') - call g:assert.equals(getline(2), '"bar" ', 'failed at #603') - call g:assert.equals(getline(3), '"baz" ', 'failed at #603') + call g:assert.equals(getline(1), '"foo" ', 'failed at #623') + call g:assert.equals(getline(2), '"bar" ', 'failed at #623') + call g:assert.equals(getline(3), '"baz" ', 'failed at #623') %delete - " #604 + " #624 " do not skip! call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) execute "normal ggsr\23l(" - call g:assert.equals(getline(1), '("foo")', 'failed at #604') - call g:assert.equals(getline(2), '("bar")', 'failed at #604') - call g:assert.equals(getline(3), '("baz")', 'failed at #604') + call g:assert.equals(getline(1), '("foo")', 'failed at #624') + call g:assert.equals(getline(2), '("bar")', 'failed at #624') + call g:assert.equals(getline(3), '("baz")', 'failed at #624') set whichwrap& call operator#sandwich#set('replace', 'block', 'skip_space', 1) @@ -7749,23 +7875,23 @@ function! s:suite.blockwise_n_option_skip_char() abort "{{{ set whichwrap=h,l """ off - " #605 + " #625 call append(0, ['aa(foo)bb', 'aa(bar)bb', 'aa(baz)bb']) execute "normal ggsr\29l\"" - call g:assert.equals(getline(1), 'aa(foo)bb', 'failed at #605') - call g:assert.equals(getline(2), 'aa(bar)bb', 'failed at #605') - call g:assert.equals(getline(3), 'aa(baz)bb', 'failed at #605') + call g:assert.equals(getline(1), 'aa(foo)bb', 'failed at #625') + call g:assert.equals(getline(2), 'aa(bar)bb', 'failed at #625') + call g:assert.equals(getline(3), 'aa(baz)bb', 'failed at #625') %delete """ on call operator#sandwich#set('replace', 'block', 'skip_char', 1) - " #606 + " #626 call append(0, ['aa(foo)bb', 'aa(bar)bb', 'aa(baz)bb']) execute "normal ggsr\29l\"" - call g:assert.equals(getline(1), 'aa"foo"bb', 'failed at #606') - call g:assert.equals(getline(2), 'aa"bar"bb', 'failed at #606') - call g:assert.equals(getline(3), 'aa"baz"bb', 'failed at #606') + call g:assert.equals(getline(1), 'aa"foo"bb', 'failed at #626') + call g:assert.equals(getline(2), 'aa"bar"bb', 'failed at #626') + call g:assert.equals(getline(3), 'aa"baz"bb', 'failed at #626') set whichwrap& call operator#sandwich#set('replace', 'block', 'skip_char', 0) @@ -7775,12 +7901,12 @@ function! s:suite.blockwise_n_option_command() abort "{{{ set whichwrap=h,l call operator#sandwich#set('replace', 'block', 'command', ["normal! `[d\`]"]) - " #607 + " #627 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal ggsr\17l\"" - call g:assert.equals(getline(1), '""', 'failed at #607') - call g:assert.equals(getline(2), '""', 'failed at #607') - call g:assert.equals(getline(3), '""', 'failed at #607') + call g:assert.equals(getline(1), '""', 'failed at #627') + call g:assert.equals(getline(2), '""', 'failed at #627') + call g:assert.equals(getline(3), '""', 'failed at #627') set whichwrap& call operator#sandwich#set('replace', 'block', 'command', []) @@ -7791,23 +7917,23 @@ function! s:suite.blockwise_n_option_query_once() abort "{{{ """"" query_once """ off - " #607 + " #627 call append(0, ['"""foo"""', '"""bar"""', '"""baz"""']) execute "normal gg3sr\29l([{" - call g:assert.equals(getline(1), '([{foo}])', 'failed at #607') - call g:assert.equals(getline(2), '([{bar}])', 'failed at #607') - call g:assert.equals(getline(3), '([{baz}])', 'failed at #607') + call g:assert.equals(getline(1), '([{foo}])', 'failed at #627') + call g:assert.equals(getline(2), '([{bar}])', 'failed at #627') + call g:assert.equals(getline(3), '([{baz}])', 'failed at #627') %delete """ on - " #608 + " #628 call operator#sandwich#set('replace', 'block', 'query_once', 1) call append(0, ['"""foo"""', '"""bar"""', '"""baz"""']) execute "normal gg3sr\29l(" - call g:assert.equals(getline(1), '(((foo)))', 'failed at #608') - call g:assert.equals(getline(2), '(((bar)))', 'failed at #608') - call g:assert.equals(getline(3), '(((baz)))', 'failed at #608') + call g:assert.equals(getline(1), '(((foo)))', 'failed at #628') + call g:assert.equals(getline(2), '(((bar)))', 'failed at #628') + call g:assert.equals(getline(3), '(((baz)))', 'failed at #628') set whichwrap& call operator#sandwich#set('replace', 'block', 'query_once', 0) @@ -7819,19 +7945,19 @@ function! s:suite.blockwise_n_option_expr() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['1+1', '1+2'], 'input':['a']}] """ 0 - " #609 + " #629 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal ggsr\17la" - call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #609') + call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #629') %delete """ 1 - " #610 + " #630 call operator#sandwich#set('replace', 'block', 'expr', 1) call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal ggsr\17la" - call g:assert.equals(getline('.'), '2foo3', 'failed at #610') + call g:assert.equals(getline('.'), '2foo3', 'failed at #630') """ 2 " This case cannot be tested since this option makes difference only in @@ -7854,535 +7980,535 @@ function! s:suite.blockwise_n_option_autoindent() abort "{{{ """ -1 call operator#sandwich#set('replace', 'block', 'autoindent', -1) - " #416 + " #631 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #416') - call g:assert.equals(getline(2), '[', 'failed at #416') - call g:assert.equals(getline(3), 'foo', 'failed at #416') - call g:assert.equals(getline(4), ']', 'failed at #416') - call g:assert.equals(getline(5), '}', 'failed at #416') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #416') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #416') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #416') - call g:assert.equals(&l:autoindent, 0, 'failed at #416') - call g:assert.equals(&l:smartindent, 0, 'failed at #416') - call g:assert.equals(&l:cindent, 0, 'failed at #416') - call g:assert.equals(&l:indentexpr, '', 'failed at #416') + call g:assert.equals(getline(1), ' {', 'failed at #631') + call g:assert.equals(getline(2), '[', 'failed at #631') + call g:assert.equals(getline(3), 'foo', 'failed at #631') + call g:assert.equals(getline(4), ']', 'failed at #631') + call g:assert.equals(getline(5), '}', 'failed at #631') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #631') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #631') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #631') + call g:assert.equals(&l:autoindent, 0, 'failed at #631') + call g:assert.equals(&l:smartindent, 0, 'failed at #631') + call g:assert.equals(&l:cindent, 0, 'failed at #631') + call g:assert.equals(&l:indentexpr, '', 'failed at #631') %delete - " #417 + " #632 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #417') - call g:assert.equals(getline(2), ' [', 'failed at #417') - call g:assert.equals(getline(3), ' foo', 'failed at #417') - call g:assert.equals(getline(4), ' ]', 'failed at #417') - call g:assert.equals(getline(5), ' }', 'failed at #417') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #417') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #417') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #417') - call g:assert.equals(&l:autoindent, 1, 'failed at #417') - call g:assert.equals(&l:smartindent, 0, 'failed at #417') - call g:assert.equals(&l:cindent, 0, 'failed at #417') - call g:assert.equals(&l:indentexpr, '', 'failed at #417') + call g:assert.equals(getline(1), ' {', 'failed at #632') + call g:assert.equals(getline(2), ' [', 'failed at #632') + call g:assert.equals(getline(3), ' foo', 'failed at #632') + call g:assert.equals(getline(4), ' ]', 'failed at #632') + call g:assert.equals(getline(5), ' }', 'failed at #632') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #632') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #632') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #632') + call g:assert.equals(&l:autoindent, 1, 'failed at #632') + call g:assert.equals(&l:smartindent, 0, 'failed at #632') + call g:assert.equals(&l:cindent, 0, 'failed at #632') + call g:assert.equals(&l:indentexpr, '', 'failed at #632') %delete - " #418 + " #633 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #418') - call g:assert.equals(getline(2), ' [', 'failed at #418') - call g:assert.equals(getline(3), ' foo', 'failed at #418') - call g:assert.equals(getline(4), ' ]', 'failed at #418') - call g:assert.equals(getline(5), '}', 'failed at #418') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #418') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #418') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #418') - call g:assert.equals(&l:autoindent, 1, 'failed at #418') - call g:assert.equals(&l:smartindent, 1, 'failed at #418') - call g:assert.equals(&l:cindent, 0, 'failed at #418') - call g:assert.equals(&l:indentexpr, '', 'failed at #418') + call g:assert.equals(getline(1), ' {', 'failed at #633') + call g:assert.equals(getline(2), ' [', 'failed at #633') + call g:assert.equals(getline(3), ' foo', 'failed at #633') + call g:assert.equals(getline(4), ' ]', 'failed at #633') + call g:assert.equals(getline(5), '}', 'failed at #633') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #633') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #633') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #633') + call g:assert.equals(&l:autoindent, 1, 'failed at #633') + call g:assert.equals(&l:smartindent, 1, 'failed at #633') + call g:assert.equals(&l:cindent, 0, 'failed at #633') + call g:assert.equals(&l:indentexpr, '', 'failed at #633') %delete - " #419 + " #634 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), '{', 'failed at #419') - call g:assert.equals(getline(2), ' [', 'failed at #419') - call g:assert.equals(getline(3), ' foo', 'failed at #419') - call g:assert.equals(getline(4), ' ]', 'failed at #419') - call g:assert.equals(getline(5), ' }', 'failed at #419') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #419') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #419') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #419') - call g:assert.equals(&l:autoindent, 1, 'failed at #419') - call g:assert.equals(&l:smartindent, 1, 'failed at #419') - call g:assert.equals(&l:cindent, 1, 'failed at #419') - call g:assert.equals(&l:indentexpr, '', 'failed at #419') + call g:assert.equals(getline(1), '{', 'failed at #634') + call g:assert.equals(getline(2), ' [', 'failed at #634') + call g:assert.equals(getline(3), ' foo', 'failed at #634') + call g:assert.equals(getline(4), ' ]', 'failed at #634') + call g:assert.equals(getline(5), ' }', 'failed at #634') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #634') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #634') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #634') + call g:assert.equals(&l:autoindent, 1, 'failed at #634') + call g:assert.equals(&l:smartindent, 1, 'failed at #634') + call g:assert.equals(&l:cindent, 1, 'failed at #634') + call g:assert.equals(&l:indentexpr, '', 'failed at #634') %delete - " #420 + " #635 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #420') - call g:assert.equals(getline(2), ' [', 'failed at #420') - call g:assert.equals(getline(3), ' foo', 'failed at #420') - call g:assert.equals(getline(4), ' ]', 'failed at #420') - call g:assert.equals(getline(5), ' }', 'failed at #420') - " call g:assert.equals(getpos('.'), [0, 3, 17, 0], 'failed at #420') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #420') - " call g:assert.equals(getpos("']"), [0, 5, 18, 0], 'failed at #420') - call g:assert.equals(&l:autoindent, 1, 'failed at #420') - call g:assert.equals(&l:smartindent, 1, 'failed at #420') - call g:assert.equals(&l:cindent, 1, 'failed at #420') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #420') + call g:assert.equals(getline(1), ' {', 'failed at #635') + call g:assert.equals(getline(2), ' [', 'failed at #635') + call g:assert.equals(getline(3), ' foo', 'failed at #635') + call g:assert.equals(getline(4), ' ]', 'failed at #635') + call g:assert.equals(getline(5), ' }', 'failed at #635') + " call g:assert.equals(getpos('.'), [0, 3, 17, 0], 'failed at #635') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #635') + " call g:assert.equals(getpos("']"), [0, 5, 18, 0], 'failed at #635') + call g:assert.equals(&l:autoindent, 1, 'failed at #635') + call g:assert.equals(&l:smartindent, 1, 'failed at #635') + call g:assert.equals(&l:cindent, 1, 'failed at #635') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #635') %delete """ 0 call operator#sandwich#set('replace', 'block', 'autoindent', 0) - " #421 + " #636 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #421') - call g:assert.equals(getline(2), '[', 'failed at #421') - call g:assert.equals(getline(3), 'foo', 'failed at #421') - call g:assert.equals(getline(4), ']', 'failed at #421') - call g:assert.equals(getline(5), '}', 'failed at #421') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #421') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #421') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #421') - call g:assert.equals(&l:autoindent, 0, 'failed at #421') - call g:assert.equals(&l:smartindent, 0, 'failed at #421') - call g:assert.equals(&l:cindent, 0, 'failed at #421') - call g:assert.equals(&l:indentexpr, '', 'failed at #421') + call g:assert.equals(getline(1), ' {', 'failed at #636') + call g:assert.equals(getline(2), '[', 'failed at #636') + call g:assert.equals(getline(3), 'foo', 'failed at #636') + call g:assert.equals(getline(4), ']', 'failed at #636') + call g:assert.equals(getline(5), '}', 'failed at #636') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #636') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #636') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #636') + call g:assert.equals(&l:autoindent, 0, 'failed at #636') + call g:assert.equals(&l:smartindent, 0, 'failed at #636') + call g:assert.equals(&l:cindent, 0, 'failed at #636') + call g:assert.equals(&l:indentexpr, '', 'failed at #636') %delete - " #422 + " #637 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #422') - call g:assert.equals(getline(2), '[', 'failed at #422') - call g:assert.equals(getline(3), 'foo', 'failed at #422') - call g:assert.equals(getline(4), ']', 'failed at #422') - call g:assert.equals(getline(5), '}', 'failed at #422') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #422') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #422') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #422') - call g:assert.equals(&l:autoindent, 1, 'failed at #422') - call g:assert.equals(&l:smartindent, 0, 'failed at #422') - call g:assert.equals(&l:cindent, 0, 'failed at #422') - call g:assert.equals(&l:indentexpr, '', 'failed at #422') + call g:assert.equals(getline(1), ' {', 'failed at #637') + call g:assert.equals(getline(2), '[', 'failed at #637') + call g:assert.equals(getline(3), 'foo', 'failed at #637') + call g:assert.equals(getline(4), ']', 'failed at #637') + call g:assert.equals(getline(5), '}', 'failed at #637') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #637') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #637') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #637') + call g:assert.equals(&l:autoindent, 1, 'failed at #637') + call g:assert.equals(&l:smartindent, 0, 'failed at #637') + call g:assert.equals(&l:cindent, 0, 'failed at #637') + call g:assert.equals(&l:indentexpr, '', 'failed at #637') %delete - " #423 + " #638 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #423') - call g:assert.equals(getline(2), '[', 'failed at #423') - call g:assert.equals(getline(3), 'foo', 'failed at #423') - call g:assert.equals(getline(4), ']', 'failed at #423') - call g:assert.equals(getline(5), '}', 'failed at #423') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #423') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #423') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #423') - call g:assert.equals(&l:autoindent, 1, 'failed at #423') - call g:assert.equals(&l:smartindent, 1, 'failed at #423') - call g:assert.equals(&l:cindent, 0, 'failed at #423') - call g:assert.equals(&l:indentexpr, '', 'failed at #423') + call g:assert.equals(getline(1), ' {', 'failed at #638') + call g:assert.equals(getline(2), '[', 'failed at #638') + call g:assert.equals(getline(3), 'foo', 'failed at #638') + call g:assert.equals(getline(4), ']', 'failed at #638') + call g:assert.equals(getline(5), '}', 'failed at #638') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #638') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #638') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #638') + call g:assert.equals(&l:autoindent, 1, 'failed at #638') + call g:assert.equals(&l:smartindent, 1, 'failed at #638') + call g:assert.equals(&l:cindent, 0, 'failed at #638') + call g:assert.equals(&l:indentexpr, '', 'failed at #638') %delete - " #424 + " #639 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #424') - call g:assert.equals(getline(2), '[', 'failed at #424') - call g:assert.equals(getline(3), 'foo', 'failed at #424') - call g:assert.equals(getline(4), ']', 'failed at #424') - call g:assert.equals(getline(5), '}', 'failed at #424') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #424') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #424') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #424') - call g:assert.equals(&l:autoindent, 1, 'failed at #424') - call g:assert.equals(&l:smartindent, 1, 'failed at #424') - call g:assert.equals(&l:cindent, 1, 'failed at #424') - call g:assert.equals(&l:indentexpr, '', 'failed at #424') + call g:assert.equals(getline(1), ' {', 'failed at #639') + call g:assert.equals(getline(2), '[', 'failed at #639') + call g:assert.equals(getline(3), 'foo', 'failed at #639') + call g:assert.equals(getline(4), ']', 'failed at #639') + call g:assert.equals(getline(5), '}', 'failed at #639') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #639') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #639') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #639') + call g:assert.equals(&l:autoindent, 1, 'failed at #639') + call g:assert.equals(&l:smartindent, 1, 'failed at #639') + call g:assert.equals(&l:cindent, 1, 'failed at #639') + call g:assert.equals(&l:indentexpr, '', 'failed at #639') %delete - " #425 + " #640 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #425') - call g:assert.equals(getline(2), '[', 'failed at #425') - call g:assert.equals(getline(3), 'foo', 'failed at #425') - call g:assert.equals(getline(4), ']', 'failed at #425') - call g:assert.equals(getline(5), '}', 'failed at #425') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #425') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #425') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #425') - call g:assert.equals(&l:autoindent, 1, 'failed at #425') - call g:assert.equals(&l:smartindent, 1, 'failed at #425') - call g:assert.equals(&l:cindent, 1, 'failed at #425') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #425') + call g:assert.equals(getline(1), ' {', 'failed at #640') + call g:assert.equals(getline(2), '[', 'failed at #640') + call g:assert.equals(getline(3), 'foo', 'failed at #640') + call g:assert.equals(getline(4), ']', 'failed at #640') + call g:assert.equals(getline(5), '}', 'failed at #640') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #640') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #640') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #640') + call g:assert.equals(&l:autoindent, 1, 'failed at #640') + call g:assert.equals(&l:smartindent, 1, 'failed at #640') + call g:assert.equals(&l:cindent, 1, 'failed at #640') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #640') %delete """ 1 call operator#sandwich#set('replace', 'block', 'autoindent', 1) - " #426 + " #641 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #426') - call g:assert.equals(getline(2), ' [', 'failed at #426') - call g:assert.equals(getline(3), ' foo', 'failed at #426') - call g:assert.equals(getline(4), ' ]', 'failed at #426') - call g:assert.equals(getline(5), ' }', 'failed at #426') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #426') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #426') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #426') - call g:assert.equals(&l:autoindent, 0, 'failed at #426') - call g:assert.equals(&l:smartindent, 0, 'failed at #426') - call g:assert.equals(&l:cindent, 0, 'failed at #426') - call g:assert.equals(&l:indentexpr, '', 'failed at #426') + call g:assert.equals(getline(1), ' {', 'failed at #641') + call g:assert.equals(getline(2), ' [', 'failed at #641') + call g:assert.equals(getline(3), ' foo', 'failed at #641') + call g:assert.equals(getline(4), ' ]', 'failed at #641') + call g:assert.equals(getline(5), ' }', 'failed at #641') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #641') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #641') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #641') + call g:assert.equals(&l:autoindent, 0, 'failed at #641') + call g:assert.equals(&l:smartindent, 0, 'failed at #641') + call g:assert.equals(&l:cindent, 0, 'failed at #641') + call g:assert.equals(&l:indentexpr, '', 'failed at #641') %delete - " #427 + " #642 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #427') - call g:assert.equals(getline(2), ' [', 'failed at #427') - call g:assert.equals(getline(3), ' foo', 'failed at #427') - call g:assert.equals(getline(4), ' ]', 'failed at #427') - call g:assert.equals(getline(5), ' }', 'failed at #427') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #427') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #427') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #427') - call g:assert.equals(&l:autoindent, 1, 'failed at #427') - call g:assert.equals(&l:smartindent, 0, 'failed at #427') - call g:assert.equals(&l:cindent, 0, 'failed at #427') - call g:assert.equals(&l:indentexpr, '', 'failed at #427') + call g:assert.equals(getline(1), ' {', 'failed at #642') + call g:assert.equals(getline(2), ' [', 'failed at #642') + call g:assert.equals(getline(3), ' foo', 'failed at #642') + call g:assert.equals(getline(4), ' ]', 'failed at #642') + call g:assert.equals(getline(5), ' }', 'failed at #642') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #642') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #642') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #642') + call g:assert.equals(&l:autoindent, 1, 'failed at #642') + call g:assert.equals(&l:smartindent, 0, 'failed at #642') + call g:assert.equals(&l:cindent, 0, 'failed at #642') + call g:assert.equals(&l:indentexpr, '', 'failed at #642') %delete - " #428 + " #643 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #428') - call g:assert.equals(getline(2), ' [', 'failed at #428') - call g:assert.equals(getline(3), ' foo', 'failed at #428') - call g:assert.equals(getline(4), ' ]', 'failed at #428') - call g:assert.equals(getline(5), ' }', 'failed at #428') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #428') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #428') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #428') - call g:assert.equals(&l:autoindent, 1, 'failed at #428') - call g:assert.equals(&l:smartindent, 1, 'failed at #428') - call g:assert.equals(&l:cindent, 0, 'failed at #428') - call g:assert.equals(&l:indentexpr, '', 'failed at #428') + call g:assert.equals(getline(1), ' {', 'failed at #643') + call g:assert.equals(getline(2), ' [', 'failed at #643') + call g:assert.equals(getline(3), ' foo', 'failed at #643') + call g:assert.equals(getline(4), ' ]', 'failed at #643') + call g:assert.equals(getline(5), ' }', 'failed at #643') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #643') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #643') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #643') + call g:assert.equals(&l:autoindent, 1, 'failed at #643') + call g:assert.equals(&l:smartindent, 1, 'failed at #643') + call g:assert.equals(&l:cindent, 0, 'failed at #643') + call g:assert.equals(&l:indentexpr, '', 'failed at #643') %delete - " #429 + " #644 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #429') - call g:assert.equals(getline(2), ' [', 'failed at #429') - call g:assert.equals(getline(3), ' foo', 'failed at #429') - call g:assert.equals(getline(4), ' ]', 'failed at #429') - call g:assert.equals(getline(5), ' }', 'failed at #429') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #429') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #429') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #429') - call g:assert.equals(&l:autoindent, 1, 'failed at #429') - call g:assert.equals(&l:smartindent, 1, 'failed at #429') - call g:assert.equals(&l:cindent, 1, 'failed at #429') - call g:assert.equals(&l:indentexpr, '', 'failed at #429') + call g:assert.equals(getline(1), ' {', 'failed at #644') + call g:assert.equals(getline(2), ' [', 'failed at #644') + call g:assert.equals(getline(3), ' foo', 'failed at #644') + call g:assert.equals(getline(4), ' ]', 'failed at #644') + call g:assert.equals(getline(5), ' }', 'failed at #644') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #644') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #644') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #644') + call g:assert.equals(&l:autoindent, 1, 'failed at #644') + call g:assert.equals(&l:smartindent, 1, 'failed at #644') + call g:assert.equals(&l:cindent, 1, 'failed at #644') + call g:assert.equals(&l:indentexpr, '', 'failed at #644') %delete - " #430 + " #645 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #430') - call g:assert.equals(getline(2), ' [', 'failed at #430') - call g:assert.equals(getline(3), ' foo', 'failed at #430') - call g:assert.equals(getline(4), ' ]', 'failed at #430') - call g:assert.equals(getline(5), ' }', 'failed at #430') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #430') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #430') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #430') - call g:assert.equals(&l:autoindent, 1, 'failed at #430') - call g:assert.equals(&l:smartindent, 1, 'failed at #430') - call g:assert.equals(&l:cindent, 1, 'failed at #430') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #430') + call g:assert.equals(getline(1), ' {', 'failed at #645') + call g:assert.equals(getline(2), ' [', 'failed at #645') + call g:assert.equals(getline(3), ' foo', 'failed at #645') + call g:assert.equals(getline(4), ' ]', 'failed at #645') + call g:assert.equals(getline(5), ' }', 'failed at #645') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #645') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #645') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #645') + call g:assert.equals(&l:autoindent, 1, 'failed at #645') + call g:assert.equals(&l:smartindent, 1, 'failed at #645') + call g:assert.equals(&l:cindent, 1, 'failed at #645') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #645') %delete """ 2 call operator#sandwich#set('replace', 'block', 'autoindent', 2) - " #431 + " #646 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #431') - call g:assert.equals(getline(2), ' [', 'failed at #431') - call g:assert.equals(getline(3), ' foo', 'failed at #431') - call g:assert.equals(getline(4), ' ]', 'failed at #431') - call g:assert.equals(getline(5), '}', 'failed at #431') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #431') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #431') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #431') - call g:assert.equals(&l:autoindent, 0, 'failed at #431') - call g:assert.equals(&l:smartindent, 0, 'failed at #431') - call g:assert.equals(&l:cindent, 0, 'failed at #431') - call g:assert.equals(&l:indentexpr, '', 'failed at #431') + call g:assert.equals(getline(1), ' {', 'failed at #646') + call g:assert.equals(getline(2), ' [', 'failed at #646') + call g:assert.equals(getline(3), ' foo', 'failed at #646') + call g:assert.equals(getline(4), ' ]', 'failed at #646') + call g:assert.equals(getline(5), '}', 'failed at #646') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #646') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #646') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #646') + call g:assert.equals(&l:autoindent, 0, 'failed at #646') + call g:assert.equals(&l:smartindent, 0, 'failed at #646') + call g:assert.equals(&l:cindent, 0, 'failed at #646') + call g:assert.equals(&l:indentexpr, '', 'failed at #646') %delete - " #432 + " #647 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #432') - call g:assert.equals(getline(2), ' [', 'failed at #432') - call g:assert.equals(getline(3), ' foo', 'failed at #432') - call g:assert.equals(getline(4), ' ]', 'failed at #432') - call g:assert.equals(getline(5), '}', 'failed at #432') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #432') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #432') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #432') - call g:assert.equals(&l:autoindent, 1, 'failed at #432') - call g:assert.equals(&l:smartindent, 0, 'failed at #432') - call g:assert.equals(&l:cindent, 0, 'failed at #432') - call g:assert.equals(&l:indentexpr, '', 'failed at #432') + call g:assert.equals(getline(1), ' {', 'failed at #647') + call g:assert.equals(getline(2), ' [', 'failed at #647') + call g:assert.equals(getline(3), ' foo', 'failed at #647') + call g:assert.equals(getline(4), ' ]', 'failed at #647') + call g:assert.equals(getline(5), '}', 'failed at #647') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #647') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #647') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #647') + call g:assert.equals(&l:autoindent, 1, 'failed at #647') + call g:assert.equals(&l:smartindent, 0, 'failed at #647') + call g:assert.equals(&l:cindent, 0, 'failed at #647') + call g:assert.equals(&l:indentexpr, '', 'failed at #647') %delete - " #433 + " #648 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #433') - call g:assert.equals(getline(2), ' [', 'failed at #433') - call g:assert.equals(getline(3), ' foo', 'failed at #433') - call g:assert.equals(getline(4), ' ]', 'failed at #433') - call g:assert.equals(getline(5), '}', 'failed at #433') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #433') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #433') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #433') - call g:assert.equals(&l:autoindent, 1, 'failed at #433') - call g:assert.equals(&l:smartindent, 1, 'failed at #433') - call g:assert.equals(&l:cindent, 0, 'failed at #433') - call g:assert.equals(&l:indentexpr, '', 'failed at #433') + call g:assert.equals(getline(1), ' {', 'failed at #648') + call g:assert.equals(getline(2), ' [', 'failed at #648') + call g:assert.equals(getline(3), ' foo', 'failed at #648') + call g:assert.equals(getline(4), ' ]', 'failed at #648') + call g:assert.equals(getline(5), '}', 'failed at #648') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #648') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #648') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #648') + call g:assert.equals(&l:autoindent, 1, 'failed at #648') + call g:assert.equals(&l:smartindent, 1, 'failed at #648') + call g:assert.equals(&l:cindent, 0, 'failed at #648') + call g:assert.equals(&l:indentexpr, '', 'failed at #648') %delete - " #434 + " #649 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #434') - call g:assert.equals(getline(2), ' [', 'failed at #434') - call g:assert.equals(getline(3), ' foo', 'failed at #434') - call g:assert.equals(getline(4), ' ]', 'failed at #434') - call g:assert.equals(getline(5), '}', 'failed at #434') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #434') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #434') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #434') - call g:assert.equals(&l:autoindent, 1, 'failed at #434') - call g:assert.equals(&l:smartindent, 1, 'failed at #434') - call g:assert.equals(&l:cindent, 1, 'failed at #434') - call g:assert.equals(&l:indentexpr, '', 'failed at #434') + call g:assert.equals(getline(1), ' {', 'failed at #649') + call g:assert.equals(getline(2), ' [', 'failed at #649') + call g:assert.equals(getline(3), ' foo', 'failed at #649') + call g:assert.equals(getline(4), ' ]', 'failed at #649') + call g:assert.equals(getline(5), '}', 'failed at #649') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #649') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #649') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #649') + call g:assert.equals(&l:autoindent, 1, 'failed at #649') + call g:assert.equals(&l:smartindent, 1, 'failed at #649') + call g:assert.equals(&l:cindent, 1, 'failed at #649') + call g:assert.equals(&l:indentexpr, '', 'failed at #649') %delete - " #435 + " #650 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #435') - call g:assert.equals(getline(2), ' [', 'failed at #435') - call g:assert.equals(getline(3), ' foo', 'failed at #435') - call g:assert.equals(getline(4), ' ]', 'failed at #435') - call g:assert.equals(getline(5), '}', 'failed at #435') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #435') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #435') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #435') - call g:assert.equals(&l:autoindent, 1, 'failed at #435') - call g:assert.equals(&l:smartindent, 1, 'failed at #435') - call g:assert.equals(&l:cindent, 1, 'failed at #435') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #435') + call g:assert.equals(getline(1), ' {', 'failed at #650') + call g:assert.equals(getline(2), ' [', 'failed at #650') + call g:assert.equals(getline(3), ' foo', 'failed at #650') + call g:assert.equals(getline(4), ' ]', 'failed at #650') + call g:assert.equals(getline(5), '}', 'failed at #650') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #650') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #650') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #650') + call g:assert.equals(&l:autoindent, 1, 'failed at #650') + call g:assert.equals(&l:smartindent, 1, 'failed at #650') + call g:assert.equals(&l:cindent, 1, 'failed at #650') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #650') %delete """ 3 call operator#sandwich#set('replace', 'block', 'autoindent', 3) - " #436 + " #651 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), '{', 'failed at #436') - call g:assert.equals(getline(2), ' [', 'failed at #436') - call g:assert.equals(getline(3), ' foo', 'failed at #436') - call g:assert.equals(getline(4), ' ]', 'failed at #436') - call g:assert.equals(getline(5), ' }', 'failed at #436') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #436') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #436') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #436') - call g:assert.equals(&l:autoindent, 0, 'failed at #436') - call g:assert.equals(&l:smartindent, 0, 'failed at #436') - call g:assert.equals(&l:cindent, 0, 'failed at #436') - call g:assert.equals(&l:indentexpr, '', 'failed at #436') + call g:assert.equals(getline(1), '{', 'failed at #651') + call g:assert.equals(getline(2), ' [', 'failed at #651') + call g:assert.equals(getline(3), ' foo', 'failed at #651') + call g:assert.equals(getline(4), ' ]', 'failed at #651') + call g:assert.equals(getline(5), ' }', 'failed at #651') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #651') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #651') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #651') + call g:assert.equals(&l:autoindent, 0, 'failed at #651') + call g:assert.equals(&l:smartindent, 0, 'failed at #651') + call g:assert.equals(&l:cindent, 0, 'failed at #651') + call g:assert.equals(&l:indentexpr, '', 'failed at #651') %delete - " #437 + " #652 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), '{', 'failed at #437') - call g:assert.equals(getline(2), ' [', 'failed at #437') - call g:assert.equals(getline(3), ' foo', 'failed at #437') - call g:assert.equals(getline(4), ' ]', 'failed at #437') - call g:assert.equals(getline(5), ' }', 'failed at #437') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #437') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #437') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #437') - call g:assert.equals(&l:autoindent, 1, 'failed at #437') - call g:assert.equals(&l:smartindent, 0, 'failed at #437') - call g:assert.equals(&l:cindent, 0, 'failed at #437') - call g:assert.equals(&l:indentexpr, '', 'failed at #437') + call g:assert.equals(getline(1), '{', 'failed at #652') + call g:assert.equals(getline(2), ' [', 'failed at #652') + call g:assert.equals(getline(3), ' foo', 'failed at #652') + call g:assert.equals(getline(4), ' ]', 'failed at #652') + call g:assert.equals(getline(5), ' }', 'failed at #652') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #652') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #652') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #652') + call g:assert.equals(&l:autoindent, 1, 'failed at #652') + call g:assert.equals(&l:smartindent, 0, 'failed at #652') + call g:assert.equals(&l:cindent, 0, 'failed at #652') + call g:assert.equals(&l:indentexpr, '', 'failed at #652') %delete - " #438 + " #653 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), '{', 'failed at #438') - call g:assert.equals(getline(2), ' [', 'failed at #438') - call g:assert.equals(getline(3), ' foo', 'failed at #438') - call g:assert.equals(getline(4), ' ]', 'failed at #438') - call g:assert.equals(getline(5), ' }', 'failed at #438') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #438') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #438') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #438') - call g:assert.equals(&l:autoindent, 1, 'failed at #438') - call g:assert.equals(&l:smartindent, 1, 'failed at #438') - call g:assert.equals(&l:cindent, 0, 'failed at #438') - call g:assert.equals(&l:indentexpr, '', 'failed at #438') + call g:assert.equals(getline(1), '{', 'failed at #653') + call g:assert.equals(getline(2), ' [', 'failed at #653') + call g:assert.equals(getline(3), ' foo', 'failed at #653') + call g:assert.equals(getline(4), ' ]', 'failed at #653') + call g:assert.equals(getline(5), ' }', 'failed at #653') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #653') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #653') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #653') + call g:assert.equals(&l:autoindent, 1, 'failed at #653') + call g:assert.equals(&l:smartindent, 1, 'failed at #653') + call g:assert.equals(&l:cindent, 0, 'failed at #653') + call g:assert.equals(&l:indentexpr, '', 'failed at #653') %delete - " #439 + " #654 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), '{', 'failed at #439') - call g:assert.equals(getline(2), ' [', 'failed at #439') - call g:assert.equals(getline(3), ' foo', 'failed at #439') - call g:assert.equals(getline(4), ' ]', 'failed at #439') - call g:assert.equals(getline(5), ' }', 'failed at #439') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #439') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #439') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #439') - call g:assert.equals(&l:autoindent, 1, 'failed at #439') - call g:assert.equals(&l:smartindent, 1, 'failed at #439') - call g:assert.equals(&l:cindent, 1, 'failed at #439') - call g:assert.equals(&l:indentexpr, '', 'failed at #439') + call g:assert.equals(getline(1), '{', 'failed at #654') + call g:assert.equals(getline(2), ' [', 'failed at #654') + call g:assert.equals(getline(3), ' foo', 'failed at #654') + call g:assert.equals(getline(4), ' ]', 'failed at #654') + call g:assert.equals(getline(5), ' }', 'failed at #654') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #654') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #654') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #654') + call g:assert.equals(&l:autoindent, 1, 'failed at #654') + call g:assert.equals(&l:smartindent, 1, 'failed at #654') + call g:assert.equals(&l:cindent, 1, 'failed at #654') + call g:assert.equals(&l:indentexpr, '', 'failed at #654') %delete - " #440 + " #655 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), '{', 'failed at #440') - call g:assert.equals(getline(2), ' [', 'failed at #440') - call g:assert.equals(getline(3), ' foo', 'failed at #440') - call g:assert.equals(getline(4), ' ]', 'failed at #440') - call g:assert.equals(getline(5), ' }', 'failed at #440') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #440') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #440') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #440') - call g:assert.equals(&l:autoindent, 1, 'failed at #440') - call g:assert.equals(&l:smartindent, 1, 'failed at #440') - call g:assert.equals(&l:cindent, 1, 'failed at #440') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #440') + call g:assert.equals(getline(1), '{', 'failed at #655') + call g:assert.equals(getline(2), ' [', 'failed at #655') + call g:assert.equals(getline(3), ' foo', 'failed at #655') + call g:assert.equals(getline(4), ' ]', 'failed at #655') + call g:assert.equals(getline(5), ' }', 'failed at #655') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #655') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #655') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #655') + call g:assert.equals(&l:autoindent, 1, 'failed at #655') + call g:assert.equals(&l:smartindent, 1, 'failed at #655') + call g:assert.equals(&l:cindent, 1, 'failed at #655') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #655') endfunction "}}} function! s:suite.blockwise_n_option_indentkeys() abort "{{{ @@ -8397,7 +8523,7 @@ function! s:suite.blockwise_n_option_indentkeys() abort "{{{ """ cinkeys call operator#sandwich#set('replace', 'block', 'autoindent', 3) - " #441 + " #656 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -8405,20 +8531,20 @@ function! s:suite.blockwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys', '0{,0},0),:,0#,!^F,e') call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), '{', 'failed at #441') - call g:assert.equals(getline(2), 'foo', 'failed at #441') - call g:assert.equals(getline(3), ' }', 'failed at #441') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #441') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #441') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #441') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #441') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #441') + call g:assert.equals(getline(1), '{', 'failed at #656') + call g:assert.equals(getline(2), 'foo', 'failed at #656') + call g:assert.equals(getline(3), ' }', 'failed at #656') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #656') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #656') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #656') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #656') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #656') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'block', 'autoindent', 3) - " #442 + " #657 setlocal cinkeys=0{,0},0),:,0#,!^F,e setlocal indentkeys& let cinkeys = &l:cinkeys @@ -8426,20 +8552,20 @@ function! s:suite.blockwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys+', 'O,o') call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), '{', 'failed at #442') - call g:assert.equals(getline(2), ' foo', 'failed at #442') - call g:assert.equals(getline(3), ' }', 'failed at #442') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #442') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #442') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #442') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #442') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #442') + call g:assert.equals(getline(1), '{', 'failed at #657') + call g:assert.equals(getline(2), ' foo', 'failed at #657') + call g:assert.equals(getline(3), ' }', 'failed at #657') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #657') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #657') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #657') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #657') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #657') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'block', 'autoindent', 3) - " #443 + " #658 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -8447,14 +8573,14 @@ function! s:suite.blockwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys-', 'O,o') call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), '{', 'failed at #443') - call g:assert.equals(getline(2), 'foo', 'failed at #443') - call g:assert.equals(getline(3), ' }', 'failed at #443') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #443') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #443') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #443') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #443') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #443') + call g:assert.equals(getline(1), '{', 'failed at #658') + call g:assert.equals(getline(2), 'foo', 'failed at #658') + call g:assert.equals(getline(3), ' }', 'failed at #658') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #658') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #658') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #658') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #658') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #658') %delete call operator#sandwich#set_default() @@ -8463,7 +8589,7 @@ function! s:suite.blockwise_n_option_indentkeys() abort "{{{ setlocal indentexpr=TestIndent() call operator#sandwich#set('replace', 'block', 'autoindent', -1) - " #444 + " #659 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -8471,20 +8597,20 @@ function! s:suite.blockwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys', '0{,0},0),:,0#,!^F,e') call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #444') - call g:assert.equals(getline(2), 'foo', 'failed at #444') - call g:assert.equals(getline(3), ' }', 'failed at #444') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #444') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #444') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #444') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #444') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #444') + call g:assert.equals(getline(1), ' {', 'failed at #659') + call g:assert.equals(getline(2), 'foo', 'failed at #659') + call g:assert.equals(getline(3), ' }', 'failed at #659') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #659') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #659') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #659') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #659') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #659') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'block', 'autoindent', -1) - " #445 + " #660 setlocal cinkeys& setlocal indentkeys=0{,0},0),:,0#,!^F,e let cinkeys = &l:cinkeys @@ -8492,20 +8618,20 @@ function! s:suite.blockwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys+', 'O,o') call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #445') - call g:assert.equals(getline(2), ' foo', 'failed at #445') - call g:assert.equals(getline(3), ' }', 'failed at #445') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #445') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #445') - " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #445') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #445') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #445') + call g:assert.equals(getline(1), ' {', 'failed at #660') + call g:assert.equals(getline(2), ' foo', 'failed at #660') + call g:assert.equals(getline(3), ' }', 'failed at #660') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #660') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #660') + " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #660') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #660') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #660') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'block', 'autoindent', -1) - " #446 + " #661 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -8513,328 +8639,328 @@ function! s:suite.blockwise_n_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys-', 'O,o') call setline('.', ' "foo"') execute "normal ^sr\2i\"a" - call g:assert.equals(getline(1), ' {', 'failed at #446') - call g:assert.equals(getline(2), 'foo', 'failed at #446') - call g:assert.equals(getline(3), ' }', 'failed at #446') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #446') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #446') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #446') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #446') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #446') + call g:assert.equals(getline(1), ' {', 'failed at #661') + call g:assert.equals(getline(2), 'foo', 'failed at #661') + call g:assert.equals(getline(3), ' }', 'failed at #661') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #661') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #661') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #661') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #661') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #661') endfunction "}}} function! s:suite.blockwise_x_default_recipes() abort "{{{ - " #611 + " #662 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal gg\2j4lsr[" - call g:assert.equals(getline(1), '[foo]', 'failed at #611') - call g:assert.equals(getline(2), '[bar]', 'failed at #611') - call g:assert.equals(getline(3), '[baz]', 'failed at #611') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #611') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #611') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #611') + call g:assert.equals(getline(1), '[foo]', 'failed at #662') + call g:assert.equals(getline(2), '[bar]', 'failed at #662') + call g:assert.equals(getline(3), '[baz]', 'failed at #662') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #662') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #662') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #662') %delete - " #612 + " #663 call append(0, ['[foo]', '[bar]', '[baz]']) execute "normal gg\2j4lsr{" - call g:assert.equals(getline(1), '{foo}', 'failed at #612') - call g:assert.equals(getline(2), '{bar}', 'failed at #612') - call g:assert.equals(getline(3), '{baz}', 'failed at #612') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #612') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #612') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #612') + call g:assert.equals(getline(1), '{foo}', 'failed at #663') + call g:assert.equals(getline(2), '{bar}', 'failed at #663') + call g:assert.equals(getline(3), '{baz}', 'failed at #663') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #663') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #663') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #663') %delete - " #613 + " #664 call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal gg\2j4lsr<" - call g:assert.equals(getline(1), '', 'failed at #613') - call g:assert.equals(getline(2), '', 'failed at #613') - call g:assert.equals(getline(3), '', 'failed at #613') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #613') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #613') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #613') + call g:assert.equals(getline(1), '', 'failed at #664') + call g:assert.equals(getline(2), '', 'failed at #664') + call g:assert.equals(getline(3), '', 'failed at #664') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #664') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #664') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #664') %delete - " #614 + " #665 call append(0, ['', '', '']) execute "normal gg\2j4lsr(" - call g:assert.equals(getline(1), '(foo)', 'failed at #614') - call g:assert.equals(getline(2), '(bar)', 'failed at #614') - call g:assert.equals(getline(3), '(baz)', 'failed at #614') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #614') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #614') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #614') + call g:assert.equals(getline(1), '(foo)', 'failed at #665') + call g:assert.equals(getline(2), '(bar)', 'failed at #665') + call g:assert.equals(getline(3), '(baz)', 'failed at #665') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #665') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #665') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #665') endfunction "}}} function! s:suite.blockwise_x_not_registered() abort "{{{ - " #615 + " #666 call append(0, ['afooa', 'abara', 'abaza']) execute "normal gg\2j4lsrb" - call g:assert.equals(getline(1), 'bfoob', 'failed at #615') - call g:assert.equals(getline(2), 'bbarb', 'failed at #615') - call g:assert.equals(getline(3), 'bbazb', 'failed at #615') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #615') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #615') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #615') + call g:assert.equals(getline(1), 'bfoob', 'failed at #666') + call g:assert.equals(getline(2), 'bbarb', 'failed at #666') + call g:assert.equals(getline(3), 'bbazb', 'failed at #666') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #666') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #666') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #666') - " #616 + " #667 call append(0, ['+foo+', '+bar+', '+baz+']) execute "normal gg\2j4lsr*" - call g:assert.equals(getline(1), '*foo*', 'failed at #616') - call g:assert.equals(getline(2), '*bar*', 'failed at #616') - call g:assert.equals(getline(3), '*baz*', 'failed at #616') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #616') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #616') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #616') + call g:assert.equals(getline(1), '*foo*', 'failed at #667') + call g:assert.equals(getline(2), '*bar*', 'failed at #667') + call g:assert.equals(getline(3), '*baz*', 'failed at #667') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #667') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #667') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #667') endfunction "}}} function! s:suite.blockwise_x_positioning() abort "{{{ - " #617 + " #668 call append(0, ['(foo)bar', '(foo)bar', '(foo)bar']) execute "normal gg\2j4lsr[" - call g:assert.equals(getline(1), '[foo]bar', 'failed at #617') - call g:assert.equals(getline(2), '[foo]bar', 'failed at #617') - call g:assert.equals(getline(3), '[foo]bar', 'failed at #617') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #617') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #617') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #617') + call g:assert.equals(getline(1), '[foo]bar', 'failed at #668') + call g:assert.equals(getline(2), '[foo]bar', 'failed at #668') + call g:assert.equals(getline(3), '[foo]bar', 'failed at #668') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #668') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #668') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #668') %delete - " #618 + " #669 call append(0, ['foo(bar)', 'foo(bar)', 'foo(bar)']) execute "normal gg3l\2j4lsr[" - call g:assert.equals(getline(1), 'foo[bar]', 'failed at #618') - call g:assert.equals(getline(2), 'foo[bar]', 'failed at #618') - call g:assert.equals(getline(3), 'foo[bar]', 'failed at #618') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #618') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #618') - call g:assert.equals(getpos("']"), [0, 3, 9, 0], 'failed at #618') + call g:assert.equals(getline(1), 'foo[bar]', 'failed at #669') + call g:assert.equals(getline(2), 'foo[bar]', 'failed at #669') + call g:assert.equals(getline(3), 'foo[bar]', 'failed at #669') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #669') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #669') + call g:assert.equals(getpos("']"), [0, 3, 9, 0], 'failed at #669') %delete - " #619 + " #670 call append(0, ['foo(bar)baz', 'foo(bar)baz', 'foo(bar)baz']) execute "normal gg3l\2j4lsr[" - call g:assert.equals(getline(1), 'foo[bar]baz', 'failed at #619') - call g:assert.equals(getline(2), 'foo[bar]baz', 'failed at #619') - call g:assert.equals(getline(3), 'foo[bar]baz', 'failed at #619') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #619') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #619') - call g:assert.equals(getpos("']"), [0, 3, 9, 0], 'failed at #619') + call g:assert.equals(getline(1), 'foo[bar]baz', 'failed at #670') + call g:assert.equals(getline(2), 'foo[bar]baz', 'failed at #670') + call g:assert.equals(getline(3), 'foo[bar]baz', 'failed at #670') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #670') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #670') + call g:assert.equals(getpos("']"), [0, 3, 9, 0], 'failed at #670') %delete - " #620 + " #671 call append(0, ['(foo)', '(bar)', 'bazbaz']) execute "normal gg\2j4lsr[" - call g:assert.equals(getline(1), '[foo]', 'failed at #620') - call g:assert.equals(getline(2), '[bar]', 'failed at #620') - call g:assert.equals(getline(3), 'bazbaz', 'failed at #620') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #620') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #620') - call g:assert.equals(getpos("']"), [0, 2, 6, 0], 'failed at #620') + call g:assert.equals(getline(1), '[foo]', 'failed at #671') + call g:assert.equals(getline(2), '[bar]', 'failed at #671') + call g:assert.equals(getline(3), 'bazbaz', 'failed at #671') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #671') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #671') + call g:assert.equals(getpos("']"), [0, 2, 6, 0], 'failed at #671') %delete - " #621 + " #672 call append(0, ['(foo)', 'barbar', '(baz)']) execute "normal gg\2j4lsr[" - call g:assert.equals(getline(1), '[foo]', 'failed at #621') - call g:assert.equals(getline(2), 'barbar', 'failed at #621') - call g:assert.equals(getline(3), '[baz]', 'failed at #621') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #621') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #621') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #621') + call g:assert.equals(getline(1), '[foo]', 'failed at #672') + call g:assert.equals(getline(2), 'barbar', 'failed at #672') + call g:assert.equals(getline(3), '[baz]', 'failed at #672') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #672') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #672') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #672') %delete - " #622 + " #673 call append(0, ['foofoo', '(bar)', '(baz)']) execute "normal gg\2j4lsr[" - call g:assert.equals(getline(1), 'foofoo', 'failed at #622') - call g:assert.equals(getline(2), '[bar]', 'failed at #622') - call g:assert.equals(getline(3), '[baz]', 'failed at #622') - call g:assert.equals(getpos('.'), [0, 2, 2, 0], 'failed at #622') - call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #622') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #622') + call g:assert.equals(getline(1), 'foofoo', 'failed at #673') + call g:assert.equals(getline(2), '[bar]', 'failed at #673') + call g:assert.equals(getline(3), '[baz]', 'failed at #673') + call g:assert.equals(getpos('.'), [0, 2, 2, 0], 'failed at #673') + call g:assert.equals(getpos("'["), [0, 2, 1, 0], 'failed at #673') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #673') %delete - " #623 + " #674 call append(0, ['(foo)', '(baar)', '(baaz)']) execute "normal gg\2j5lsr[" - call g:assert.equals(getline(1), '[foo]', 'failed at #623') - call g:assert.equals(getline(2), '[baar]', 'failed at #623') - call g:assert.equals(getline(3), '[baaz]', 'failed at #623') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #623') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #623') - call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #623') + call g:assert.equals(getline(1), '[foo]', 'failed at #674') + call g:assert.equals(getline(2), '[baar]', 'failed at #674') + call g:assert.equals(getline(3), '[baaz]', 'failed at #674') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #674') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #674') + call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #674') %delete - " #624 + " #675 call append(0, ['(fooo)', '(bar)', '(baaz)']) execute "normal gg\2j5lsr[" - call g:assert.equals(getline(1), '[fooo]', 'failed at #624') - call g:assert.equals(getline(2), '[bar]', 'failed at #624') - call g:assert.equals(getline(3), '[baaz]', 'failed at #624') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #624') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #624') - call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #624') + call g:assert.equals(getline(1), '[fooo]', 'failed at #675') + call g:assert.equals(getline(2), '[bar]', 'failed at #675') + call g:assert.equals(getline(3), '[baaz]', 'failed at #675') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #675') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #675') + call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #675') %delete - " #625 + " #676 call append(0, ['(fooo)', '(baar)', '(baz)']) set virtualedit=block execute "normal gg\2j5lsr[" - call g:assert.equals(getline(1), '[fooo]', 'failed at #625') - call g:assert.equals(getline(2), '[baar]', 'failed at #625') - call g:assert.equals(getline(3), '[baz]', 'failed at #625') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #625') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #625') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #625') + call g:assert.equals(getline(1), '[fooo]', 'failed at #676') + call g:assert.equals(getline(2), '[baar]', 'failed at #676') + call g:assert.equals(getline(3), '[baz]', 'failed at #676') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #676') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #676') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #676') set virtualedit& %delete """ terminal-extended block-wise visual mode - " #626 + " #677 call append(0, ['"fooo"', '"baaar"', '"baz"']) execute "normal gg\2j$sr(" - call g:assert.equals(getline(1), '(fooo)', 'failed at #626') - call g:assert.equals(getline(2), '(baaar)', 'failed at #626') - call g:assert.equals(getline(3), '(baz)', 'failed at #626') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #626') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #626') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #626') + call g:assert.equals(getline(1), '(fooo)', 'failed at #677') + call g:assert.equals(getline(2), '(baaar)', 'failed at #677') + call g:assert.equals(getline(3), '(baz)', 'failed at #677') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #677') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #677') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #677') %delete - " #627 + " #678 call append(0, ['"foooo"', '"bar"', '"baaz"']) execute "normal gg\2j$sr(" - call g:assert.equals(getline(1), '(foooo)', 'failed at #627') - call g:assert.equals(getline(2), '(bar)', 'failed at #627') - call g:assert.equals(getline(3), '(baaz)', 'failed at #627') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #627') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #627') - call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #627') + call g:assert.equals(getline(1), '(foooo)', 'failed at #678') + call g:assert.equals(getline(2), '(bar)', 'failed at #678') + call g:assert.equals(getline(3), '(baaz)', 'failed at #678') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #678') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #678') + call g:assert.equals(getpos("']"), [0, 3, 7, 0], 'failed at #678') %delete - " #628 + " #679 call append(0, ['"fooo"', '', '"baz"']) execute "normal gg\2j$sr(" - call g:assert.equals(getline(1), '(fooo)', 'failed at #628') - call g:assert.equals(getline(2), '', 'failed at #628') - call g:assert.equals(getline(3), '(baz)', 'failed at #628') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #628') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #628') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #628') + call g:assert.equals(getline(1), '(fooo)', 'failed at #679') + call g:assert.equals(getline(2), '', 'failed at #679') + call g:assert.equals(getline(3), '(baz)', 'failed at #679') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #679') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #679') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #679') endfunction "}}} function! s:suite.blockwise_x_a_character() abort "{{{ - " #629 + " #680 call append(0, ['(a)', '(b)', '(c)']) execute "normal gg\2j2lsr[" - call g:assert.equals(getline(1), '[a]', 'failed at #629') - call g:assert.equals(getline(2), '[b]', 'failed at #629') - call g:assert.equals(getline(3), '[c]', 'failed at #629') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #629') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #629') - call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #629') + call g:assert.equals(getline(1), '[a]', 'failed at #680') + call g:assert.equals(getline(2), '[b]', 'failed at #680') + call g:assert.equals(getline(3), '[c]', 'failed at #680') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #680') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #680') + call g:assert.equals(getpos("']"), [0, 3, 4, 0], 'failed at #680') endfunction "}}} function! s:suite.blockwise_x_nothing_inside() abort "{{{ - " #630 + " #681 call append(0, ['()', '()', '()']) execute "normal gg\2jlsr[" - call g:assert.equals(getline(1), '[]', 'failed at #630') - call g:assert.equals(getline(2), '[]', 'failed at #630') - call g:assert.equals(getline(3), '[]', 'failed at #630') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #630') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #630') - call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #630') + call g:assert.equals(getline(1), '[]', 'failed at #681') + call g:assert.equals(getline(2), '[]', 'failed at #681') + call g:assert.equals(getline(3), '[]', 'failed at #681') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #681') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #681') + call g:assert.equals(getpos("']"), [0, 3, 3, 0], 'failed at #681') %delete - " #631 + " #682 call append(0, ['foo()bar', 'foo()bar', 'foo()bar']) execute "normal gg3l\2jlsr[" - call g:assert.equals(getline(1), 'foo[]bar', 'failed at #631') - call g:assert.equals(getline(2), 'foo[]bar', 'failed at #631') - call g:assert.equals(getline(3), 'foo[]bar', 'failed at #631') - call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #631') - call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #631') - call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #631') + call g:assert.equals(getline(1), 'foo[]bar', 'failed at #682') + call g:assert.equals(getline(2), 'foo[]bar', 'failed at #682') + call g:assert.equals(getline(3), 'foo[]bar', 'failed at #682') + call g:assert.equals(getpos('.'), [0, 1, 5, 0], 'failed at #682') + call g:assert.equals(getpos("'["), [0, 1, 4, 0], 'failed at #682') + call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #682') endfunction "}}} function! s:suite.blockwise_x_count() abort "{{{ - " #632 + " #683 call append(0, ['[(foo)]', '[(bar)]', '[(baz)]']) execute "normal gg\2j6l3sr({" - call g:assert.equals(getline(1), '({foo})', 'failed at #632') - call g:assert.equals(getline(2), '({bar})', 'failed at #632') - call g:assert.equals(getline(3), '({baz})', 'failed at #632') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #632') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #632') - call g:assert.equals(getpos("']"), [0, 3, 8, 0], 'failed at #632') + call g:assert.equals(getline(1), '({foo})', 'failed at #683') + call g:assert.equals(getline(2), '({bar})', 'failed at #683') + call g:assert.equals(getline(3), '({baz})', 'failed at #683') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #683') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #683') + call g:assert.equals(getpos("']"), [0, 3, 8, 0], 'failed at #683') %delete - " #633 + " #684 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[(baz)]}']) execute "normal gg\2j8l3sr({[" - call g:assert.equals(getline(1), '({[foo]})', 'failed at #633') - call g:assert.equals(getline(2), '({[bar]})', 'failed at #633') - call g:assert.equals(getline(3), '({[baz]})', 'failed at #633') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #633') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #633') - call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #633') + call g:assert.equals(getline(1), '({[foo]})', 'failed at #684') + call g:assert.equals(getline(2), '({[bar]})', 'failed at #684') + call g:assert.equals(getline(3), '({[baz]})', 'failed at #684') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #684') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #684') + call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #684') %delete - " #634 + " #685 call append(0, ['{[afoob]}', '{[(bar)]}', '{[(baz)]}']) execute "normal gg\2j8l3sr({[" - call g:assert.equals(getline(1), '({afoob})', 'failed at #634') - call g:assert.equals(getline(2), '({[bar]})', 'failed at #634') - call g:assert.equals(getline(3), '({[baz]})', 'failed at #634') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #634') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #634') - call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #634') + call g:assert.equals(getline(1), '({afoob})', 'failed at #685') + call g:assert.equals(getline(2), '({[bar]})', 'failed at #685') + call g:assert.equals(getline(3), '({[baz]})', 'failed at #685') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #685') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #685') + call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #685') %delete - " #635 + " #686 call append(0, ['{[(foo)]}', '{[abarb]}', '{[(baz)]}']) execute "normal gg\2j8l3sr({[" - call g:assert.equals(getline(1), '({[foo]})', 'failed at #635') - call g:assert.equals(getline(2), '({abarb})', 'failed at #635') - call g:assert.equals(getline(3), '({[baz]})', 'failed at #635') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #635') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #635') - call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #635') + call g:assert.equals(getline(1), '({[foo]})', 'failed at #686') + call g:assert.equals(getline(2), '({abarb})', 'failed at #686') + call g:assert.equals(getline(3), '({[baz]})', 'failed at #686') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #686') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #686') + call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #686') %delete - " #636 + " #687 call append(0, ['{[(foo)]}', '{[(bar)]}', '{[abazb]}']) execute "normal gg\2j8l3sr({[" - call g:assert.equals(getline(1), '({[foo]})', 'failed at #636') - call g:assert.equals(getline(2), '({[bar]})', 'failed at #636') - call g:assert.equals(getline(3), '({abazb})', 'failed at #636') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #636') - call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #636') - call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #636') + call g:assert.equals(getline(1), '({[foo]})', 'failed at #687') + call g:assert.equals(getline(2), '({[bar]})', 'failed at #687') + call g:assert.equals(getline(3), '({abazb})', 'failed at #687') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #687') + call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #687') + call g:assert.equals(getpos("']"), [0, 3, 10, 0], 'failed at #687') endfunction "}}} function! s:suite.blockwise_x_external_textobj() abort "{{{ @@ -8846,39 +8972,39 @@ function! s:suite.blockwise_x_external_textobj() abort "{{{ \ {'external': ['it', 'at']}, \ ] - " #637 + " #688 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal gg\2j4lsr\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #637') - call g:assert.equals(getline(2), '"bar"', 'failed at #637') - call g:assert.equals(getline(3), '"baz"', 'failed at #637') + call g:assert.equals(getline(1), '"foo"', 'failed at #688') + call g:assert.equals(getline(2), '"bar"', 'failed at #688') + call g:assert.equals(getline(3), '"baz"', 'failed at #688') %delete - " #638 + " #689 call append(0, ['[foo]', '[bar]', '[baz]']) execute "normal gg\2j4lsr\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #638') - call g:assert.equals(getline(2), '"bar"', 'failed at #638') - call g:assert.equals(getline(3), '"baz"', 'failed at #638') + call g:assert.equals(getline(1), '"foo"', 'failed at #689') + call g:assert.equals(getline(2), '"bar"', 'failed at #689') + call g:assert.equals(getline(3), '"baz"', 'failed at #689') %delete - " #639 + " #690 call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal gg\2j4lsr\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #639') - call g:assert.equals(getline(2), '"bar"', 'failed at #639') - call g:assert.equals(getline(3), '"baz"', 'failed at #639') + call g:assert.equals(getline(1), '"foo"', 'failed at #690') + call g:assert.equals(getline(2), '"bar"', 'failed at #690') + call g:assert.equals(getline(3), '"baz"', 'failed at #690') %delete - " #640 + " #691 call append(0, ['foo', 'bar', 'baz']) execute "normal gg\2j17lsr\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #640') - call g:assert.equals(getline(2), '"bar"', 'failed at #640') - call g:assert.equals(getline(3), '"baz"', 'failed at #640') + call g:assert.equals(getline(1), '"foo"', 'failed at #691') + call g:assert.equals(getline(2), '"bar"', 'failed at #691') + call g:assert.equals(getline(3), '"baz"', 'failed at #691') unlet g:sandwich#recipes unlet g:operator#sandwich#recipes @@ -8887,96 +9013,96 @@ endfunction function! s:suite.blockwise_x_option_cursor() abort "{{{ """"" cursor """ inner_head - " #641 + " #692 call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg\2j8l2sr[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #641') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #641') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #641') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #641') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #692') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #692') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #692') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #692') - " #642 + " #693 execute "normal \2j4lsr[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #642') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #642') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #642') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #642') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #693') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #693') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #693') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #693') %delete """ keep - " #643 + " #694 call operator#sandwich#set('replace', 'block', 'cursor', 'keep') call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg\2j8l2sr[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #643') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #643') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #643') - call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #643') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #694') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #694') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #694') + call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #694') - " #644 + " #695 execute "normal 2h\2k4hsr[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #644') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #644') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #644') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #644') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #695') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #695') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #695') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #695') %delete """ inner_tail - " #645 + " #696 call operator#sandwich#set('replace', 'block', 'cursor', 'inner_tail') call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg\2j8l2sr[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #645') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #645') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #645') - call g:assert.equals(getpos('.'), [0, 3, 7, 0], 'failed at #645') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #696') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #696') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #696') + call g:assert.equals(getpos('.'), [0, 3, 7, 0], 'failed at #696') - " #646 + " #697 execute "normal gg2l\2j4lsr[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #646') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #646') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #646') - call g:assert.equals(getpos('.'), [0, 3, 6, 0], 'failed at #646') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #697') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #697') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #697') + call g:assert.equals(getpos('.'), [0, 3, 6, 0], 'failed at #697') %delete """ head - " #647 + " #698 call operator#sandwich#set('replace', 'block', 'cursor', 'head') call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg\2j8l2sr[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #647') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #647') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #647') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #647') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #698') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #698') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #698') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #698') - " #648 + " #699 execute "normal 2l\2j4lsr[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #648') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #648') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #648') - call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #648') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #699') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #699') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #699') + call g:assert.equals(getpos('.'), [0, 1, 3, 0], 'failed at #699') %delete """ tail - " #649 + " #700 call operator#sandwich#set('replace', 'block', 'cursor', 'tail') call append(0, ['(((foo)))', '(((bar)))', '(((baz)))']) execute "normal gg\2j8l2sr[]" - call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #649') - call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #649') - call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #649') - call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #649') + call g:assert.equals(getline(1), '[[(foo)]]', 'failed at #700') + call g:assert.equals(getline(2), '[[(bar)]]', 'failed at #700') + call g:assert.equals(getline(3), '[[(baz)]]', 'failed at #700') + call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #700') - " #650 + " #701 execute "normal 6h2k\2j4lsr[" - call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #650') - call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #650') - call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #650') - call g:assert.equals(getpos('.'), [0, 3, 7, 0], 'failed at #650') + call g:assert.equals(getline(1), '[[[foo]]]', 'failed at #701') + call g:assert.equals(getline(2), '[[[bar]]]', 'failed at #701') + call g:assert.equals(getline(3), '[[[baz]]]', 'failed at #701') + call g:assert.equals(getpos('.'), [0, 3, 7, 0], 'failed at #701') call operator#sandwich#set('replace', 'block', 'cursor', 'inner_head') endfunction @@ -8989,41 +9115,41 @@ function! s:suite.blockwise_x_option_noremap() abort "{{{ xnoremap a{ a( """ on - " #651 + " #702 call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal gg\2j4lsr\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #651') - call g:assert.equals(getline(2), '"bar"', 'failed at #651') - call g:assert.equals(getline(3), '"baz"', 'failed at #651') + call g:assert.equals(getline(1), '"foo"', 'failed at #702') + call g:assert.equals(getline(2), '"bar"', 'failed at #702') + call g:assert.equals(getline(3), '"baz"', 'failed at #702') %delete - " #652 + " #703 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal gg\2j4lsr\"" - call g:assert.equals(getline(1), '(foo)', 'failed at #652') - call g:assert.equals(getline(2), '(bar)', 'failed at #652') - call g:assert.equals(getline(3), '(baz)', 'failed at #652') + call g:assert.equals(getline(1), '(foo)', 'failed at #703') + call g:assert.equals(getline(2), '(bar)', 'failed at #703') + call g:assert.equals(getline(3), '(baz)', 'failed at #703') %delete """ off - " #653 + " #704 call operator#sandwich#set('replace', 'block', 'noremap', 0) call append(0, ['{foo}', '{bar}', '{baz}']) execute "normal gg\2j4lsr\"" - call g:assert.equals(getline(1), '{foo}', 'failed at #653') - call g:assert.equals(getline(2), '{bar}', 'failed at #653') - call g:assert.equals(getline(3), '{baz}', 'failed at #653') + call g:assert.equals(getline(1), '{foo}', 'failed at #704') + call g:assert.equals(getline(2), '{bar}', 'failed at #704') + call g:assert.equals(getline(3), '{baz}', 'failed at #704') %delete - " #654 + " #705 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal gg\2j4lsr\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #654') - call g:assert.equals(getline(2), '"bar"', 'failed at #654') - call g:assert.equals(getline(3), '"baz"', 'failed at #654') + call g:assert.equals(getline(1), '"foo"', 'failed at #705') + call g:assert.equals(getline(2), '"bar"', 'failed at #705') + call g:assert.equals(getline(3), '"baz"', 'failed at #705') unlet! g:sandwich#recipes unlet! g:operator#sandwich#recipes @@ -9037,41 +9163,41 @@ function! s:suite.blockwise_x_option_regex() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['\d\+', '\d\+']}] """ off - " #655 + " #706 call append(0, ['\d\+foo\d\+', '\d\+bar\d\+', '\d\+baz\d\+']) execute "normal gg\2j10lsr\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #655') - call g:assert.equals(getline(2), '"bar"', 'failed at #655') - call g:assert.equals(getline(3), '"baz"', 'failed at #655') + call g:assert.equals(getline(1), '"foo"', 'failed at #706') + call g:assert.equals(getline(2), '"bar"', 'failed at #706') + call g:assert.equals(getline(3), '"baz"', 'failed at #706') %delete - " #656 + " #707 call append(0, ['888foo888', '888bar888', '888baz888']) execute "normal gg\2j8lsr\"" - call g:assert.equals(getline(1), '"88foo88"', 'failed at #656') - call g:assert.equals(getline(2), '"88bar88"', 'failed at #656') - call g:assert.equals(getline(3), '"88baz88"', 'failed at #656') + call g:assert.equals(getline(1), '"88foo88"', 'failed at #707') + call g:assert.equals(getline(2), '"88bar88"', 'failed at #707') + call g:assert.equals(getline(3), '"88baz88"', 'failed at #707') %delete """ on call operator#sandwich#set('replace', 'block', 'regex', 1) - " #657 + " #708 call append(0, ['\d\+foo\d\+', '\d\+bar\d\+', '\d\+baz\d\+']) execute "normal gg\2j10lsr\"" - call g:assert.equals(getline(1), '\d\+foo\d\+', 'failed at #657') - call g:assert.equals(getline(2), '\d\+bar\d\+', 'failed at #657') - call g:assert.equals(getline(3), '\d\+baz\d\+', 'failed at #657') + call g:assert.equals(getline(1), '\d\+foo\d\+', 'failed at #708') + call g:assert.equals(getline(2), '\d\+bar\d\+', 'failed at #708') + call g:assert.equals(getline(3), '\d\+baz\d\+', 'failed at #708') %delete - " #658 + " #709 call append(0, ['888foo888', '888bar888', '888baz888']) execute "normal gg\2j8lsr\"" - call g:assert.equals(getline(1), '"foo"', 'failed at #658') - call g:assert.equals(getline(2), '"bar"', 'failed at #658') - call g:assert.equals(getline(3), '"baz"', 'failed at #658') + call g:assert.equals(getline(1), '"foo"', 'failed at #709') + call g:assert.equals(getline(2), '"bar"', 'failed at #709') + call g:assert.equals(getline(3), '"baz"', 'failed at #709') call operator#sandwich#set('replace', 'block', 'regex', 0) unlet! g:sandwich#recipes @@ -9079,103 +9205,141 @@ function! s:suite.blockwise_x_option_regex() abort "{{{ endfunction "}}} function! s:suite.blockwise_x_option_skip_space() abort "{{{ - """ on - " #659 + """ 1 + " #710 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal gg\2j4lsr(" - call g:assert.equals(getline(1), '(foo)', 'failed at #659') - call g:assert.equals(getline(2), '(bar)', 'failed at #659') - call g:assert.equals(getline(3), '(baz)', 'failed at #659') + call g:assert.equals(getline(1), '(foo)', 'failed at #710') + call g:assert.equals(getline(2), '(bar)', 'failed at #710') + call g:assert.equals(getline(3), '(baz)', 'failed at #710') %delete - " #660 + " #711 call append(0, [' "foo"', ' "bar"', ' "baz"']) execute "normal gg0\2j5lsr(" - call g:assert.equals(getline(1), ' (foo)', 'failed at #660') - call g:assert.equals(getline(2), ' (bar)', 'failed at #660') - call g:assert.equals(getline(3), ' (baz)', 'failed at #660') + call g:assert.equals(getline(1), ' (foo)', 'failed at #711') + call g:assert.equals(getline(2), ' (bar)', 'failed at #711') + call g:assert.equals(getline(3), ' (baz)', 'failed at #711') %delete - " #661 + " #712 call append(0, ['"foo" ', '"bar" ', '"baz" ']) execute "normal gg\2j5lsr(" - call g:assert.equals(getline(1), '(foo) ', 'failed at #661') - call g:assert.equals(getline(2), '(bar) ', 'failed at #661') - call g:assert.equals(getline(3), '(baz) ', 'failed at #661') + call g:assert.equals(getline(1), '(foo) ', 'failed at #712') + call g:assert.equals(getline(2), '(bar) ', 'failed at #712') + call g:assert.equals(getline(3), '(baz) ', 'failed at #712') %delete - " #662 + " #713 " do not skip! call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) execute "normal gg0\2j6lsr(" - call g:assert.equals(getline(1), '("foo")', 'failed at #662') - call g:assert.equals(getline(2), '("bar")', 'failed at #662') - call g:assert.equals(getline(3), '("baz")', 'failed at #662') + call g:assert.equals(getline(1), '("foo")', 'failed at #713') + call g:assert.equals(getline(2), '("bar")', 'failed at #713') + call g:assert.equals(getline(3), '("baz")', 'failed at #713') %delete - """ off + """ 2 + call operator#sandwich#set('replace', 'block', 'skip_space', 2) + " #714 + call append(0, ['"foo"', '"bar"', '"baz"']) + execute "normal gg\2j4lsr(" + call g:assert.equals(getline(1), '(foo)', 'failed at #714') + call g:assert.equals(getline(2), '(bar)', 'failed at #714') + call g:assert.equals(getline(3), '(baz)', 'failed at #714') + + %delete + + " #715 + call append(0, [' "foo"', ' "bar"', ' "baz"']) + execute "normal gg0\2j5lsr(" + call g:assert.equals(getline(1), ' (foo)', 'failed at #715') + call g:assert.equals(getline(2), ' (bar)', 'failed at #715') + call g:assert.equals(getline(3), ' (baz)', 'failed at #715') + + %delete + + " #716 + call append(0, ['"foo" ', '"bar" ', '"baz" ']) + execute "normal gg\2j5lsr(" + call g:assert.equals(getline(1), '(foo) ', 'failed at #716') + call g:assert.equals(getline(2), '(bar) ', 'failed at #716') + call g:assert.equals(getline(3), '(baz) ', 'failed at #716') + + %delete + + " #717 + call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) + execute "normal gg0\2j6lsr(" + call g:assert.equals(getline(1), ' (foo) ', 'failed at #717') + call g:assert.equals(getline(2), ' (bar) ', 'failed at #717') + call g:assert.equals(getline(3), ' (baz) ', 'failed at #717') + + %delete + + """ 0 call operator#sandwich#set('replace', 'block', 'skip_space', 0) - " #663 + " #718 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal gg\2j4lsr(" - call g:assert.equals(getline(1), '(foo)', 'failed at #663') - call g:assert.equals(getline(2), '(bar)', 'failed at #663') - call g:assert.equals(getline(3), '(baz)', 'failed at #663') + call g:assert.equals(getline(1), '(foo)', 'failed at #718') + call g:assert.equals(getline(2), '(bar)', 'failed at #718') + call g:assert.equals(getline(3), '(baz)', 'failed at #718') %delete - " #664 + " #719 call append(0, [' "foo"', ' "bar"', ' "baz"']) execute "normal gg0\2j5lsr(" - call g:assert.equals(getline(1), ' "foo"', 'failed at #664') - call g:assert.equals(getline(2), ' "bar"', 'failed at #664') - call g:assert.equals(getline(3), ' "baz"', 'failed at #664') + call g:assert.equals(getline(1), ' "foo"', 'failed at #719') + call g:assert.equals(getline(2), ' "bar"', 'failed at #719') + call g:assert.equals(getline(3), ' "baz"', 'failed at #719') %delete - " #665 + " #720 call append(0, ['"foo" ', '"bar" ', '"baz" ']) execute "normal gg\2j5lsr(" - call g:assert.equals(getline(1), '"foo" ', 'failed at #665') - call g:assert.equals(getline(2), '"bar" ', 'failed at #665') - call g:assert.equals(getline(3), '"baz" ', 'failed at #665') + call g:assert.equals(getline(1), '"foo" ', 'failed at #720') + call g:assert.equals(getline(2), '"bar" ', 'failed at #720') + call g:assert.equals(getline(3), '"baz" ', 'failed at #720') %delete - " #666 + " #721 " do not skip! call append(0, [' "foo" ', ' "bar" ', ' "baz" ']) execute "normal gg0\2j6lsr(" - call g:assert.equals(getline(1), '("foo")', 'failed at #666') - call g:assert.equals(getline(2), '("bar")', 'failed at #666') - call g:assert.equals(getline(3), '("baz")', 'failed at #666') + call g:assert.equals(getline(1), '("foo")', 'failed at #721') + call g:assert.equals(getline(2), '("bar")', 'failed at #721') + call g:assert.equals(getline(3), '("baz")', 'failed at #721') call operator#sandwich#set('replace', 'block', 'skip_space', 1) endfunction "}}} function! s:suite.blockwise_x_option_skip_char() abort "{{{ """ off - " #667 + " #722 call append(0, ['aa(foo)bb', 'aa(bar)bb', 'aa(baz)bb']) execute "normal gg\2j8lsr\"" - call g:assert.equals(getline(1), 'aa(foo)bb', 'failed at #667') - call g:assert.equals(getline(2), 'aa(bar)bb', 'failed at #667') - call g:assert.equals(getline(3), 'aa(baz)bb', 'failed at #667') + call g:assert.equals(getline(1), 'aa(foo)bb', 'failed at #722') + call g:assert.equals(getline(2), 'aa(bar)bb', 'failed at #722') + call g:assert.equals(getline(3), 'aa(baz)bb', 'failed at #722') %delete """ on call operator#sandwich#set('replace', 'block', 'skip_char', 1) - " #668 + " #723 call append(0, ['aa(foo)bb', 'aa(bar)bb', 'aa(baz)bb']) execute "normal gg\2j8lsr\"" - call g:assert.equals(getline(1), 'aa"foo"bb', 'failed at #668') - call g:assert.equals(getline(2), 'aa"bar"bb', 'failed at #668') - call g:assert.equals(getline(3), 'aa"baz"bb', 'failed at #668') + call g:assert.equals(getline(1), 'aa"foo"bb', 'failed at #723') + call g:assert.equals(getline(2), 'aa"bar"bb', 'failed at #723') + call g:assert.equals(getline(3), 'aa"baz"bb', 'failed at #723') call operator#sandwich#set('replace', 'block', 'skip_char', 0) endfunction @@ -9183,12 +9347,12 @@ endfunction function! s:suite.blockwise_x_option_command() abort "{{{ call operator#sandwich#set('replace', 'block', 'command', ["normal! `[d\`]"]) - " #669 + " #724 call append(0, ['(foo)', '(bar)', '(baz)']) execute "normal gg\2j4lsr\"" - call g:assert.equals(getline(1), '""', 'failed at #669') - call g:assert.equals(getline(2), '""', 'failed at #669') - call g:assert.equals(getline(3), '""', 'failed at #669') + call g:assert.equals(getline(1), '""', 'failed at #724') + call g:assert.equals(getline(2), '""', 'failed at #724') + call g:assert.equals(getline(3), '""', 'failed at #724') call operator#sandwich#set('replace', 'block', 'command', []) endfunction @@ -9196,23 +9360,23 @@ endfunction function! s:suite.blockwise_x_option_query_once() abort "{{{ """"" query_once """ off - " #669 + " #724 call append(0, ['"""foo"""', '"""bar"""', '"""baz"""']) execute "normal gg\2j8l3sr([{" - call g:assert.equals(getline(1), '([{foo}])', 'failed at #669') - call g:assert.equals(getline(2), '([{bar}])', 'failed at #669') - call g:assert.equals(getline(3), '([{baz}])', 'failed at #669') + call g:assert.equals(getline(1), '([{foo}])', 'failed at #724') + call g:assert.equals(getline(2), '([{bar}])', 'failed at #724') + call g:assert.equals(getline(3), '([{baz}])', 'failed at #724') %delete """ on - " #670 + " #725 call operator#sandwich#set('replace', 'block', 'query_once', 1) call append(0, ['"""foo"""', '"""bar"""', '"""baz"""']) execute "normal gg\2j8l3sr(" - call g:assert.equals(getline(1), '(((foo)))', 'failed at #670') - call g:assert.equals(getline(2), '(((bar)))', 'failed at #670') - call g:assert.equals(getline(3), '(((baz)))', 'failed at #670') + call g:assert.equals(getline(1), '(((foo)))', 'failed at #725') + call g:assert.equals(getline(2), '(((bar)))', 'failed at #725') + call g:assert.equals(getline(3), '(((baz)))', 'failed at #725') call operator#sandwich#set('replace', 'block', 'query_once', 0) endfunction @@ -9222,19 +9386,19 @@ function! s:suite.blockwise_x_option_expr() abort "{{{ let g:operator#sandwich#recipes = [{'buns': ['1+1', '1+2'], 'input':['a']}] """ 0 - " #671 + " #726 call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal gg\2j4lsra" - call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #671') + call g:assert.equals(getline('.'), '1+1foo1+2', 'failed at #726') %delete """ 1 - " #672 + " #727 call operator#sandwich#set('replace', 'block', 'expr', 1) call append(0, ['"foo"', '"bar"', '"baz"']) execute "normal gg\2j4lsra" - call g:assert.equals(getline('.'), '2foo3', 'failed at #672') + call g:assert.equals(getline('.'), '2foo3', 'failed at #727') """ 2 " This case cannot be tested since this option makes difference only in @@ -9256,535 +9420,535 @@ function! s:suite.blockwise_x_option_autoindent() abort "{{{ """ -1 call operator#sandwich#set('replace', 'block', 'autoindent', -1) - " #416 + " #728 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #416') - call g:assert.equals(getline(2), '[', 'failed at #416') - call g:assert.equals(getline(3), 'foo', 'failed at #416') - call g:assert.equals(getline(4), ']', 'failed at #416') - call g:assert.equals(getline(5), '}', 'failed at #416') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #416') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #416') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #416') - call g:assert.equals(&l:autoindent, 0, 'failed at #416') - call g:assert.equals(&l:smartindent, 0, 'failed at #416') - call g:assert.equals(&l:cindent, 0, 'failed at #416') - call g:assert.equals(&l:indentexpr, '', 'failed at #416') + call g:assert.equals(getline(1), ' {', 'failed at #728') + call g:assert.equals(getline(2), '[', 'failed at #728') + call g:assert.equals(getline(3), 'foo', 'failed at #728') + call g:assert.equals(getline(4), ']', 'failed at #728') + call g:assert.equals(getline(5), '}', 'failed at #728') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #728') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #728') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #728') + call g:assert.equals(&l:autoindent, 0, 'failed at #728') + call g:assert.equals(&l:smartindent, 0, 'failed at #728') + call g:assert.equals(&l:cindent, 0, 'failed at #728') + call g:assert.equals(&l:indentexpr, '', 'failed at #728') %delete - " #417 + " #729 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #417') - call g:assert.equals(getline(2), ' [', 'failed at #417') - call g:assert.equals(getline(3), ' foo', 'failed at #417') - call g:assert.equals(getline(4), ' ]', 'failed at #417') - call g:assert.equals(getline(5), ' }', 'failed at #417') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #417') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #417') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #417') - call g:assert.equals(&l:autoindent, 1, 'failed at #417') - call g:assert.equals(&l:smartindent, 0, 'failed at #417') - call g:assert.equals(&l:cindent, 0, 'failed at #417') - call g:assert.equals(&l:indentexpr, '', 'failed at #417') + call g:assert.equals(getline(1), ' {', 'failed at #729') + call g:assert.equals(getline(2), ' [', 'failed at #729') + call g:assert.equals(getline(3), ' foo', 'failed at #729') + call g:assert.equals(getline(4), ' ]', 'failed at #729') + call g:assert.equals(getline(5), ' }', 'failed at #729') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #729') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #729') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #729') + call g:assert.equals(&l:autoindent, 1, 'failed at #729') + call g:assert.equals(&l:smartindent, 0, 'failed at #729') + call g:assert.equals(&l:cindent, 0, 'failed at #729') + call g:assert.equals(&l:indentexpr, '', 'failed at #729') %delete - " #418 + " #730 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #418') - call g:assert.equals(getline(2), ' [', 'failed at #418') - call g:assert.equals(getline(3), ' foo', 'failed at #418') - call g:assert.equals(getline(4), ' ]', 'failed at #418') - call g:assert.equals(getline(5), '}', 'failed at #418') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #418') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #418') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #418') - call g:assert.equals(&l:autoindent, 1, 'failed at #418') - call g:assert.equals(&l:smartindent, 1, 'failed at #418') - call g:assert.equals(&l:cindent, 0, 'failed at #418') - call g:assert.equals(&l:indentexpr, '', 'failed at #418') + call g:assert.equals(getline(1), ' {', 'failed at #730') + call g:assert.equals(getline(2), ' [', 'failed at #730') + call g:assert.equals(getline(3), ' foo', 'failed at #730') + call g:assert.equals(getline(4), ' ]', 'failed at #730') + call g:assert.equals(getline(5), '}', 'failed at #730') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #730') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #730') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #730') + call g:assert.equals(&l:autoindent, 1, 'failed at #730') + call g:assert.equals(&l:smartindent, 1, 'failed at #730') + call g:assert.equals(&l:cindent, 0, 'failed at #730') + call g:assert.equals(&l:indentexpr, '', 'failed at #730') %delete - " #419 + " #731 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), '{', 'failed at #419') - call g:assert.equals(getline(2), ' [', 'failed at #419') - call g:assert.equals(getline(3), ' foo', 'failed at #419') - call g:assert.equals(getline(4), ' ]', 'failed at #419') - call g:assert.equals(getline(5), ' }', 'failed at #419') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #419') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #419') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #419') - call g:assert.equals(&l:autoindent, 1, 'failed at #419') - call g:assert.equals(&l:smartindent, 1, 'failed at #419') - call g:assert.equals(&l:cindent, 1, 'failed at #419') - call g:assert.equals(&l:indentexpr, '', 'failed at #419') + call g:assert.equals(getline(1), '{', 'failed at #731') + call g:assert.equals(getline(2), ' [', 'failed at #731') + call g:assert.equals(getline(3), ' foo', 'failed at #731') + call g:assert.equals(getline(4), ' ]', 'failed at #731') + call g:assert.equals(getline(5), ' }', 'failed at #731') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #731') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #731') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #731') + call g:assert.equals(&l:autoindent, 1, 'failed at #731') + call g:assert.equals(&l:smartindent, 1, 'failed at #731') + call g:assert.equals(&l:cindent, 1, 'failed at #731') + call g:assert.equals(&l:indentexpr, '', 'failed at #731') %delete - " #420 + " #732 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #420') - call g:assert.equals(getline(2), ' [', 'failed at #420') - call g:assert.equals(getline(3), ' foo', 'failed at #420') - call g:assert.equals(getline(4), ' ]', 'failed at #420') - call g:assert.equals(getline(5), ' }', 'failed at #420') - " call g:assert.equals(getpos('.'), [0, 3, 17, 0], 'failed at #420') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #420') - " call g:assert.equals(getpos("']"), [0, 5, 18, 0], 'failed at #420') - call g:assert.equals(&l:autoindent, 1, 'failed at #420') - call g:assert.equals(&l:smartindent, 1, 'failed at #420') - call g:assert.equals(&l:cindent, 1, 'failed at #420') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #420') + call g:assert.equals(getline(1), ' {', 'failed at #732') + call g:assert.equals(getline(2), ' [', 'failed at #732') + call g:assert.equals(getline(3), ' foo', 'failed at #732') + call g:assert.equals(getline(4), ' ]', 'failed at #732') + call g:assert.equals(getline(5), ' }', 'failed at #732') + " call g:assert.equals(getpos('.'), [0, 3, 17, 0], 'failed at #732') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #732') + " call g:assert.equals(getpos("']"), [0, 5, 18, 0], 'failed at #732') + call g:assert.equals(&l:autoindent, 1, 'failed at #732') + call g:assert.equals(&l:smartindent, 1, 'failed at #732') + call g:assert.equals(&l:cindent, 1, 'failed at #732') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #732') %delete """ 0 call operator#sandwich#set('replace', 'block', 'autoindent', 0) - " #421 + " #733 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #421') - call g:assert.equals(getline(2), '[', 'failed at #421') - call g:assert.equals(getline(3), 'foo', 'failed at #421') - call g:assert.equals(getline(4), ']', 'failed at #421') - call g:assert.equals(getline(5), '}', 'failed at #421') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #421') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #421') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #421') - call g:assert.equals(&l:autoindent, 0, 'failed at #421') - call g:assert.equals(&l:smartindent, 0, 'failed at #421') - call g:assert.equals(&l:cindent, 0, 'failed at #421') - call g:assert.equals(&l:indentexpr, '', 'failed at #421') + call g:assert.equals(getline(1), ' {', 'failed at #733') + call g:assert.equals(getline(2), '[', 'failed at #733') + call g:assert.equals(getline(3), 'foo', 'failed at #733') + call g:assert.equals(getline(4), ']', 'failed at #733') + call g:assert.equals(getline(5), '}', 'failed at #733') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #733') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #733') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #733') + call g:assert.equals(&l:autoindent, 0, 'failed at #733') + call g:assert.equals(&l:smartindent, 0, 'failed at #733') + call g:assert.equals(&l:cindent, 0, 'failed at #733') + call g:assert.equals(&l:indentexpr, '', 'failed at #733') %delete - " #422 + " #734 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #422') - call g:assert.equals(getline(2), '[', 'failed at #422') - call g:assert.equals(getline(3), 'foo', 'failed at #422') - call g:assert.equals(getline(4), ']', 'failed at #422') - call g:assert.equals(getline(5), '}', 'failed at #422') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #422') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #422') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #422') - call g:assert.equals(&l:autoindent, 1, 'failed at #422') - call g:assert.equals(&l:smartindent, 0, 'failed at #422') - call g:assert.equals(&l:cindent, 0, 'failed at #422') - call g:assert.equals(&l:indentexpr, '', 'failed at #422') + call g:assert.equals(getline(1), ' {', 'failed at #734') + call g:assert.equals(getline(2), '[', 'failed at #734') + call g:assert.equals(getline(3), 'foo', 'failed at #734') + call g:assert.equals(getline(4), ']', 'failed at #734') + call g:assert.equals(getline(5), '}', 'failed at #734') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #734') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #734') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #734') + call g:assert.equals(&l:autoindent, 1, 'failed at #734') + call g:assert.equals(&l:smartindent, 0, 'failed at #734') + call g:assert.equals(&l:cindent, 0, 'failed at #734') + call g:assert.equals(&l:indentexpr, '', 'failed at #734') %delete - " #423 + " #735 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #423') - call g:assert.equals(getline(2), '[', 'failed at #423') - call g:assert.equals(getline(3), 'foo', 'failed at #423') - call g:assert.equals(getline(4), ']', 'failed at #423') - call g:assert.equals(getline(5), '}', 'failed at #423') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #423') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #423') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #423') - call g:assert.equals(&l:autoindent, 1, 'failed at #423') - call g:assert.equals(&l:smartindent, 1, 'failed at #423') - call g:assert.equals(&l:cindent, 0, 'failed at #423') - call g:assert.equals(&l:indentexpr, '', 'failed at #423') + call g:assert.equals(getline(1), ' {', 'failed at #735') + call g:assert.equals(getline(2), '[', 'failed at #735') + call g:assert.equals(getline(3), 'foo', 'failed at #735') + call g:assert.equals(getline(4), ']', 'failed at #735') + call g:assert.equals(getline(5), '}', 'failed at #735') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #735') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #735') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #735') + call g:assert.equals(&l:autoindent, 1, 'failed at #735') + call g:assert.equals(&l:smartindent, 1, 'failed at #735') + call g:assert.equals(&l:cindent, 0, 'failed at #735') + call g:assert.equals(&l:indentexpr, '', 'failed at #735') %delete - " #424 + " #736 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #424') - call g:assert.equals(getline(2), '[', 'failed at #424') - call g:assert.equals(getline(3), 'foo', 'failed at #424') - call g:assert.equals(getline(4), ']', 'failed at #424') - call g:assert.equals(getline(5), '}', 'failed at #424') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #424') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #424') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #424') - call g:assert.equals(&l:autoindent, 1, 'failed at #424') - call g:assert.equals(&l:smartindent, 1, 'failed at #424') - call g:assert.equals(&l:cindent, 1, 'failed at #424') - call g:assert.equals(&l:indentexpr, '', 'failed at #424') + call g:assert.equals(getline(1), ' {', 'failed at #736') + call g:assert.equals(getline(2), '[', 'failed at #736') + call g:assert.equals(getline(3), 'foo', 'failed at #736') + call g:assert.equals(getline(4), ']', 'failed at #736') + call g:assert.equals(getline(5), '}', 'failed at #736') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #736') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #736') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #736') + call g:assert.equals(&l:autoindent, 1, 'failed at #736') + call g:assert.equals(&l:smartindent, 1, 'failed at #736') + call g:assert.equals(&l:cindent, 1, 'failed at #736') + call g:assert.equals(&l:indentexpr, '', 'failed at #736') %delete - " #425 + " #737 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #425') - call g:assert.equals(getline(2), '[', 'failed at #425') - call g:assert.equals(getline(3), 'foo', 'failed at #425') - call g:assert.equals(getline(4), ']', 'failed at #425') - call g:assert.equals(getline(5), '}', 'failed at #425') - " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #425') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #425') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #425') - call g:assert.equals(&l:autoindent, 1, 'failed at #425') - call g:assert.equals(&l:smartindent, 1, 'failed at #425') - call g:assert.equals(&l:cindent, 1, 'failed at #425') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #425') + call g:assert.equals(getline(1), ' {', 'failed at #737') + call g:assert.equals(getline(2), '[', 'failed at #737') + call g:assert.equals(getline(3), 'foo', 'failed at #737') + call g:assert.equals(getline(4), ']', 'failed at #737') + call g:assert.equals(getline(5), '}', 'failed at #737') + " call g:assert.equals(getpos('.'), [0, 3, 1, 0], 'failed at #737') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #737') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #737') + call g:assert.equals(&l:autoindent, 1, 'failed at #737') + call g:assert.equals(&l:smartindent, 1, 'failed at #737') + call g:assert.equals(&l:cindent, 1, 'failed at #737') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #737') %delete """ 1 call operator#sandwich#set('replace', 'block', 'autoindent', 1) - " #426 + " #738 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #426') - call g:assert.equals(getline(2), ' [', 'failed at #426') - call g:assert.equals(getline(3), ' foo', 'failed at #426') - call g:assert.equals(getline(4), ' ]', 'failed at #426') - call g:assert.equals(getline(5), ' }', 'failed at #426') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #426') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #426') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #426') - call g:assert.equals(&l:autoindent, 0, 'failed at #426') - call g:assert.equals(&l:smartindent, 0, 'failed at #426') - call g:assert.equals(&l:cindent, 0, 'failed at #426') - call g:assert.equals(&l:indentexpr, '', 'failed at #426') + call g:assert.equals(getline(1), ' {', 'failed at #738') + call g:assert.equals(getline(2), ' [', 'failed at #738') + call g:assert.equals(getline(3), ' foo', 'failed at #738') + call g:assert.equals(getline(4), ' ]', 'failed at #738') + call g:assert.equals(getline(5), ' }', 'failed at #738') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #738') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #738') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #738') + call g:assert.equals(&l:autoindent, 0, 'failed at #738') + call g:assert.equals(&l:smartindent, 0, 'failed at #738') + call g:assert.equals(&l:cindent, 0, 'failed at #738') + call g:assert.equals(&l:indentexpr, '', 'failed at #738') %delete - " #427 + " #739 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #427') - call g:assert.equals(getline(2), ' [', 'failed at #427') - call g:assert.equals(getline(3), ' foo', 'failed at #427') - call g:assert.equals(getline(4), ' ]', 'failed at #427') - call g:assert.equals(getline(5), ' }', 'failed at #427') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #427') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #427') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #427') - call g:assert.equals(&l:autoindent, 1, 'failed at #427') - call g:assert.equals(&l:smartindent, 0, 'failed at #427') - call g:assert.equals(&l:cindent, 0, 'failed at #427') - call g:assert.equals(&l:indentexpr, '', 'failed at #427') + call g:assert.equals(getline(1), ' {', 'failed at #739') + call g:assert.equals(getline(2), ' [', 'failed at #739') + call g:assert.equals(getline(3), ' foo', 'failed at #739') + call g:assert.equals(getline(4), ' ]', 'failed at #739') + call g:assert.equals(getline(5), ' }', 'failed at #739') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #739') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #739') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #739') + call g:assert.equals(&l:autoindent, 1, 'failed at #739') + call g:assert.equals(&l:smartindent, 0, 'failed at #739') + call g:assert.equals(&l:cindent, 0, 'failed at #739') + call g:assert.equals(&l:indentexpr, '', 'failed at #739') %delete - " #428 + " #740 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #428') - call g:assert.equals(getline(2), ' [', 'failed at #428') - call g:assert.equals(getline(3), ' foo', 'failed at #428') - call g:assert.equals(getline(4), ' ]', 'failed at #428') - call g:assert.equals(getline(5), ' }', 'failed at #428') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #428') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #428') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #428') - call g:assert.equals(&l:autoindent, 1, 'failed at #428') - call g:assert.equals(&l:smartindent, 1, 'failed at #428') - call g:assert.equals(&l:cindent, 0, 'failed at #428') - call g:assert.equals(&l:indentexpr, '', 'failed at #428') + call g:assert.equals(getline(1), ' {', 'failed at #740') + call g:assert.equals(getline(2), ' [', 'failed at #740') + call g:assert.equals(getline(3), ' foo', 'failed at #740') + call g:assert.equals(getline(4), ' ]', 'failed at #740') + call g:assert.equals(getline(5), ' }', 'failed at #740') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #740') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #740') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #740') + call g:assert.equals(&l:autoindent, 1, 'failed at #740') + call g:assert.equals(&l:smartindent, 1, 'failed at #740') + call g:assert.equals(&l:cindent, 0, 'failed at #740') + call g:assert.equals(&l:indentexpr, '', 'failed at #740') %delete - " #429 + " #741 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #429') - call g:assert.equals(getline(2), ' [', 'failed at #429') - call g:assert.equals(getline(3), ' foo', 'failed at #429') - call g:assert.equals(getline(4), ' ]', 'failed at #429') - call g:assert.equals(getline(5), ' }', 'failed at #429') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #429') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #429') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #429') - call g:assert.equals(&l:autoindent, 1, 'failed at #429') - call g:assert.equals(&l:smartindent, 1, 'failed at #429') - call g:assert.equals(&l:cindent, 1, 'failed at #429') - call g:assert.equals(&l:indentexpr, '', 'failed at #429') + call g:assert.equals(getline(1), ' {', 'failed at #741') + call g:assert.equals(getline(2), ' [', 'failed at #741') + call g:assert.equals(getline(3), ' foo', 'failed at #741') + call g:assert.equals(getline(4), ' ]', 'failed at #741') + call g:assert.equals(getline(5), ' }', 'failed at #741') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #741') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #741') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #741') + call g:assert.equals(&l:autoindent, 1, 'failed at #741') + call g:assert.equals(&l:smartindent, 1, 'failed at #741') + call g:assert.equals(&l:cindent, 1, 'failed at #741') + call g:assert.equals(&l:indentexpr, '', 'failed at #741') %delete - " #430 + " #742 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #430') - call g:assert.equals(getline(2), ' [', 'failed at #430') - call g:assert.equals(getline(3), ' foo', 'failed at #430') - call g:assert.equals(getline(4), ' ]', 'failed at #430') - call g:assert.equals(getline(5), ' }', 'failed at #430') - " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #430') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #430') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #430') - call g:assert.equals(&l:autoindent, 1, 'failed at #430') - call g:assert.equals(&l:smartindent, 1, 'failed at #430') - call g:assert.equals(&l:cindent, 1, 'failed at #430') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #430') + call g:assert.equals(getline(1), ' {', 'failed at #742') + call g:assert.equals(getline(2), ' [', 'failed at #742') + call g:assert.equals(getline(3), ' foo', 'failed at #742') + call g:assert.equals(getline(4), ' ]', 'failed at #742') + call g:assert.equals(getline(5), ' }', 'failed at #742') + " call g:assert.equals(getpos('.'), [0, 3, 5, 0], 'failed at #742') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #742') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #742') + call g:assert.equals(&l:autoindent, 1, 'failed at #742') + call g:assert.equals(&l:smartindent, 1, 'failed at #742') + call g:assert.equals(&l:cindent, 1, 'failed at #742') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #742') %delete """ 2 call operator#sandwich#set('replace', 'block', 'autoindent', 2) - " #431 + " #743 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #431') - call g:assert.equals(getline(2), ' [', 'failed at #431') - call g:assert.equals(getline(3), ' foo', 'failed at #431') - call g:assert.equals(getline(4), ' ]', 'failed at #431') - call g:assert.equals(getline(5), '}', 'failed at #431') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #431') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #431') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #431') - call g:assert.equals(&l:autoindent, 0, 'failed at #431') - call g:assert.equals(&l:smartindent, 0, 'failed at #431') - call g:assert.equals(&l:cindent, 0, 'failed at #431') - call g:assert.equals(&l:indentexpr, '', 'failed at #431') + call g:assert.equals(getline(1), ' {', 'failed at #743') + call g:assert.equals(getline(2), ' [', 'failed at #743') + call g:assert.equals(getline(3), ' foo', 'failed at #743') + call g:assert.equals(getline(4), ' ]', 'failed at #743') + call g:assert.equals(getline(5), '}', 'failed at #743') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #743') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #743') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #743') + call g:assert.equals(&l:autoindent, 0, 'failed at #743') + call g:assert.equals(&l:smartindent, 0, 'failed at #743') + call g:assert.equals(&l:cindent, 0, 'failed at #743') + call g:assert.equals(&l:indentexpr, '', 'failed at #743') %delete - " #432 + " #744 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #432') - call g:assert.equals(getline(2), ' [', 'failed at #432') - call g:assert.equals(getline(3), ' foo', 'failed at #432') - call g:assert.equals(getline(4), ' ]', 'failed at #432') - call g:assert.equals(getline(5), '}', 'failed at #432') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #432') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #432') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #432') - call g:assert.equals(&l:autoindent, 1, 'failed at #432') - call g:assert.equals(&l:smartindent, 0, 'failed at #432') - call g:assert.equals(&l:cindent, 0, 'failed at #432') - call g:assert.equals(&l:indentexpr, '', 'failed at #432') + call g:assert.equals(getline(1), ' {', 'failed at #744') + call g:assert.equals(getline(2), ' [', 'failed at #744') + call g:assert.equals(getline(3), ' foo', 'failed at #744') + call g:assert.equals(getline(4), ' ]', 'failed at #744') + call g:assert.equals(getline(5), '}', 'failed at #744') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #744') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #744') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #744') + call g:assert.equals(&l:autoindent, 1, 'failed at #744') + call g:assert.equals(&l:smartindent, 0, 'failed at #744') + call g:assert.equals(&l:cindent, 0, 'failed at #744') + call g:assert.equals(&l:indentexpr, '', 'failed at #744') %delete - " #433 + " #745 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #433') - call g:assert.equals(getline(2), ' [', 'failed at #433') - call g:assert.equals(getline(3), ' foo', 'failed at #433') - call g:assert.equals(getline(4), ' ]', 'failed at #433') - call g:assert.equals(getline(5), '}', 'failed at #433') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #433') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #433') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #433') - call g:assert.equals(&l:autoindent, 1, 'failed at #433') - call g:assert.equals(&l:smartindent, 1, 'failed at #433') - call g:assert.equals(&l:cindent, 0, 'failed at #433') - call g:assert.equals(&l:indentexpr, '', 'failed at #433') + call g:assert.equals(getline(1), ' {', 'failed at #745') + call g:assert.equals(getline(2), ' [', 'failed at #745') + call g:assert.equals(getline(3), ' foo', 'failed at #745') + call g:assert.equals(getline(4), ' ]', 'failed at #745') + call g:assert.equals(getline(5), '}', 'failed at #745') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #745') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #745') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #745') + call g:assert.equals(&l:autoindent, 1, 'failed at #745') + call g:assert.equals(&l:smartindent, 1, 'failed at #745') + call g:assert.equals(&l:cindent, 0, 'failed at #745') + call g:assert.equals(&l:indentexpr, '', 'failed at #745') %delete - " #434 + " #746 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #434') - call g:assert.equals(getline(2), ' [', 'failed at #434') - call g:assert.equals(getline(3), ' foo', 'failed at #434') - call g:assert.equals(getline(4), ' ]', 'failed at #434') - call g:assert.equals(getline(5), '}', 'failed at #434') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #434') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #434') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #434') - call g:assert.equals(&l:autoindent, 1, 'failed at #434') - call g:assert.equals(&l:smartindent, 1, 'failed at #434') - call g:assert.equals(&l:cindent, 1, 'failed at #434') - call g:assert.equals(&l:indentexpr, '', 'failed at #434') + call g:assert.equals(getline(1), ' {', 'failed at #746') + call g:assert.equals(getline(2), ' [', 'failed at #746') + call g:assert.equals(getline(3), ' foo', 'failed at #746') + call g:assert.equals(getline(4), ' ]', 'failed at #746') + call g:assert.equals(getline(5), '}', 'failed at #746') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #746') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #746') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #746') + call g:assert.equals(&l:autoindent, 1, 'failed at #746') + call g:assert.equals(&l:smartindent, 1, 'failed at #746') + call g:assert.equals(&l:cindent, 1, 'failed at #746') + call g:assert.equals(&l:indentexpr, '', 'failed at #746') %delete - " #435 + " #747 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #435') - call g:assert.equals(getline(2), ' [', 'failed at #435') - call g:assert.equals(getline(3), ' foo', 'failed at #435') - call g:assert.equals(getline(4), ' ]', 'failed at #435') - call g:assert.equals(getline(5), '}', 'failed at #435') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #435') - " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #435') - " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #435') - call g:assert.equals(&l:autoindent, 1, 'failed at #435') - call g:assert.equals(&l:smartindent, 1, 'failed at #435') - call g:assert.equals(&l:cindent, 1, 'failed at #435') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #435') + call g:assert.equals(getline(1), ' {', 'failed at #747') + call g:assert.equals(getline(2), ' [', 'failed at #747') + call g:assert.equals(getline(3), ' foo', 'failed at #747') + call g:assert.equals(getline(4), ' ]', 'failed at #747') + call g:assert.equals(getline(5), '}', 'failed at #747') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #747') + " call g:assert.equals(getpos("'["), [0, 1, 5, 0], 'failed at #747') + " call g:assert.equals(getpos("']"), [0, 5, 2, 0], 'failed at #747') + call g:assert.equals(&l:autoindent, 1, 'failed at #747') + call g:assert.equals(&l:smartindent, 1, 'failed at #747') + call g:assert.equals(&l:cindent, 1, 'failed at #747') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #747') %delete """ 3 call operator#sandwich#set('replace', 'block', 'autoindent', 3) - " #436 + " #748 setlocal noautoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), '{', 'failed at #436') - call g:assert.equals(getline(2), ' [', 'failed at #436') - call g:assert.equals(getline(3), ' foo', 'failed at #436') - call g:assert.equals(getline(4), ' ]', 'failed at #436') - call g:assert.equals(getline(5), ' }', 'failed at #436') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #436') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #436') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #436') - call g:assert.equals(&l:autoindent, 0, 'failed at #436') - call g:assert.equals(&l:smartindent, 0, 'failed at #436') - call g:assert.equals(&l:cindent, 0, 'failed at #436') - call g:assert.equals(&l:indentexpr, '', 'failed at #436') + call g:assert.equals(getline(1), '{', 'failed at #748') + call g:assert.equals(getline(2), ' [', 'failed at #748') + call g:assert.equals(getline(3), ' foo', 'failed at #748') + call g:assert.equals(getline(4), ' ]', 'failed at #748') + call g:assert.equals(getline(5), ' }', 'failed at #748') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #748') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #748') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #748') + call g:assert.equals(&l:autoindent, 0, 'failed at #748') + call g:assert.equals(&l:smartindent, 0, 'failed at #748') + call g:assert.equals(&l:cindent, 0, 'failed at #748') + call g:assert.equals(&l:indentexpr, '', 'failed at #748') %delete - " #437 + " #749 setlocal autoindent setlocal nosmartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), '{', 'failed at #437') - call g:assert.equals(getline(2), ' [', 'failed at #437') - call g:assert.equals(getline(3), ' foo', 'failed at #437') - call g:assert.equals(getline(4), ' ]', 'failed at #437') - call g:assert.equals(getline(5), ' }', 'failed at #437') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #437') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #437') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #437') - call g:assert.equals(&l:autoindent, 1, 'failed at #437') - call g:assert.equals(&l:smartindent, 0, 'failed at #437') - call g:assert.equals(&l:cindent, 0, 'failed at #437') - call g:assert.equals(&l:indentexpr, '', 'failed at #437') + call g:assert.equals(getline(1), '{', 'failed at #749') + call g:assert.equals(getline(2), ' [', 'failed at #749') + call g:assert.equals(getline(3), ' foo', 'failed at #749') + call g:assert.equals(getline(4), ' ]', 'failed at #749') + call g:assert.equals(getline(5), ' }', 'failed at #749') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #749') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #749') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #749') + call g:assert.equals(&l:autoindent, 1, 'failed at #749') + call g:assert.equals(&l:smartindent, 0, 'failed at #749') + call g:assert.equals(&l:cindent, 0, 'failed at #749') + call g:assert.equals(&l:indentexpr, '', 'failed at #749') %delete - " #438 + " #750 setlocal smartindent setlocal nocindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), '{', 'failed at #438') - call g:assert.equals(getline(2), ' [', 'failed at #438') - call g:assert.equals(getline(3), ' foo', 'failed at #438') - call g:assert.equals(getline(4), ' ]', 'failed at #438') - call g:assert.equals(getline(5), ' }', 'failed at #438') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #438') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #438') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #438') - call g:assert.equals(&l:autoindent, 1, 'failed at #438') - call g:assert.equals(&l:smartindent, 1, 'failed at #438') - call g:assert.equals(&l:cindent, 0, 'failed at #438') - call g:assert.equals(&l:indentexpr, '', 'failed at #438') + call g:assert.equals(getline(1), '{', 'failed at #750') + call g:assert.equals(getline(2), ' [', 'failed at #750') + call g:assert.equals(getline(3), ' foo', 'failed at #750') + call g:assert.equals(getline(4), ' ]', 'failed at #750') + call g:assert.equals(getline(5), ' }', 'failed at #750') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #750') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #750') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #750') + call g:assert.equals(&l:autoindent, 1, 'failed at #750') + call g:assert.equals(&l:smartindent, 1, 'failed at #750') + call g:assert.equals(&l:cindent, 0, 'failed at #750') + call g:assert.equals(&l:indentexpr, '', 'failed at #750') %delete - " #439 + " #751 setlocal cindent setlocal indentexpr= call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), '{', 'failed at #439') - call g:assert.equals(getline(2), ' [', 'failed at #439') - call g:assert.equals(getline(3), ' foo', 'failed at #439') - call g:assert.equals(getline(4), ' ]', 'failed at #439') - call g:assert.equals(getline(5), ' }', 'failed at #439') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #439') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #439') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #439') - call g:assert.equals(&l:autoindent, 1, 'failed at #439') - call g:assert.equals(&l:smartindent, 1, 'failed at #439') - call g:assert.equals(&l:cindent, 1, 'failed at #439') - call g:assert.equals(&l:indentexpr, '', 'failed at #439') + call g:assert.equals(getline(1), '{', 'failed at #751') + call g:assert.equals(getline(2), ' [', 'failed at #751') + call g:assert.equals(getline(3), ' foo', 'failed at #751') + call g:assert.equals(getline(4), ' ]', 'failed at #751') + call g:assert.equals(getline(5), ' }', 'failed at #751') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #751') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #751') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #751') + call g:assert.equals(&l:autoindent, 1, 'failed at #751') + call g:assert.equals(&l:smartindent, 1, 'failed at #751') + call g:assert.equals(&l:cindent, 1, 'failed at #751') + call g:assert.equals(&l:indentexpr, '', 'failed at #751') %delete - " #440 + " #752 setlocal indentexpr=TestIndent() call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), '{', 'failed at #440') - call g:assert.equals(getline(2), ' [', 'failed at #440') - call g:assert.equals(getline(3), ' foo', 'failed at #440') - call g:assert.equals(getline(4), ' ]', 'failed at #440') - call g:assert.equals(getline(5), ' }', 'failed at #440') - " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #440') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #440') - " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #440') - call g:assert.equals(&l:autoindent, 1, 'failed at #440') - call g:assert.equals(&l:smartindent, 1, 'failed at #440') - call g:assert.equals(&l:cindent, 1, 'failed at #440') - call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #440') + call g:assert.equals(getline(1), '{', 'failed at #752') + call g:assert.equals(getline(2), ' [', 'failed at #752') + call g:assert.equals(getline(3), ' foo', 'failed at #752') + call g:assert.equals(getline(4), ' ]', 'failed at #752') + call g:assert.equals(getline(5), ' }', 'failed at #752') + " call g:assert.equals(getpos('.'), [0, 3, 9, 0], 'failed at #752') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #752') + " call g:assert.equals(getpos("']"), [0, 5, 6, 0], 'failed at #752') + call g:assert.equals(&l:autoindent, 1, 'failed at #752') + call g:assert.equals(&l:smartindent, 1, 'failed at #752') + call g:assert.equals(&l:cindent, 1, 'failed at #752') + call g:assert.equals(&l:indentexpr, 'TestIndent()', 'failed at #752') endfunction "}}} function! s:suite.blockwise_x_option_indentkeys() abort "{{{ @@ -9799,7 +9963,7 @@ function! s:suite.blockwise_x_option_indentkeys() abort "{{{ """ cinkeys call operator#sandwich#set('replace', 'block', 'autoindent', 3) - " #441 + " #753 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -9807,20 +9971,20 @@ function! s:suite.blockwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys', '0{,0},0),:,0#,!^F,e') call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), '{', 'failed at #441') - call g:assert.equals(getline(2), 'foo', 'failed at #441') - call g:assert.equals(getline(3), ' }', 'failed at #441') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #441') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #441') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #441') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #441') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #441') + call g:assert.equals(getline(1), '{', 'failed at #753') + call g:assert.equals(getline(2), 'foo', 'failed at #753') + call g:assert.equals(getline(3), ' }', 'failed at #753') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #753') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #753') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #753') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #753') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #753') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'block', 'autoindent', 3) - " #442 + " #754 setlocal cinkeys=0{,0},0),:,0#,!^F,e setlocal indentkeys& let cinkeys = &l:cinkeys @@ -9828,20 +9992,20 @@ function! s:suite.blockwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys+', 'O,o') call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), '{', 'failed at #442') - call g:assert.equals(getline(2), ' foo', 'failed at #442') - call g:assert.equals(getline(3), ' }', 'failed at #442') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #442') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #442') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #442') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #442') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #442') + call g:assert.equals(getline(1), '{', 'failed at #754') + call g:assert.equals(getline(2), ' foo', 'failed at #754') + call g:assert.equals(getline(3), ' }', 'failed at #754') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #754') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #754') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #754') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #754') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #754') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'block', 'autoindent', 3) - " #443 + " #755 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -9849,14 +10013,14 @@ function! s:suite.blockwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys-', 'O,o') call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), '{', 'failed at #443') - call g:assert.equals(getline(2), 'foo', 'failed at #443') - call g:assert.equals(getline(3), ' }', 'failed at #443') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #443') - " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #443') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #443') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #443') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #443') + call g:assert.equals(getline(1), '{', 'failed at #755') + call g:assert.equals(getline(2), 'foo', 'failed at #755') + call g:assert.equals(getline(3), ' }', 'failed at #755') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #755') + " call g:assert.equals(getpos("'["), [0, 1, 1, 0], 'failed at #755') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #755') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #755') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #755') %delete call operator#sandwich#set_default() @@ -9865,7 +10029,7 @@ function! s:suite.blockwise_x_option_indentkeys() abort "{{{ setlocal indentexpr=TestIndent() call operator#sandwich#set('replace', 'block', 'autoindent', -1) - " #444 + " #756 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -9873,20 +10037,20 @@ function! s:suite.blockwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys', '0{,0},0),:,0#,!^F,e') call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #444') - call g:assert.equals(getline(2), 'foo', 'failed at #444') - call g:assert.equals(getline(3), ' }', 'failed at #444') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #444') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #444') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #444') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #444') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #444') + call g:assert.equals(getline(1), ' {', 'failed at #756') + call g:assert.equals(getline(2), 'foo', 'failed at #756') + call g:assert.equals(getline(3), ' }', 'failed at #756') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #756') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #756') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #756') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #756') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #756') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'block', 'autoindent', -1) - " #445 + " #757 setlocal cinkeys& setlocal indentkeys=0{,0},0),:,0#,!^F,e let cinkeys = &l:cinkeys @@ -9894,20 +10058,20 @@ function! s:suite.blockwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys+', 'O,o') call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #445') - call g:assert.equals(getline(2), ' foo', 'failed at #445') - call g:assert.equals(getline(3), ' }', 'failed at #445') - " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #445') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #445') - " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #445') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #445') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #445') + call g:assert.equals(getline(1), ' {', 'failed at #757') + call g:assert.equals(getline(2), ' foo', 'failed at #757') + call g:assert.equals(getline(3), ' }', 'failed at #757') + " call g:assert.equals(getpos('.'), [0, 2, 5, 0], 'failed at #757') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #757') + " call g:assert.equals(getpos("']"), [0, 3, 14, 0], 'failed at #757') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #757') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #757') %delete call operator#sandwich#set_default() call operator#sandwich#set('replace', 'block', 'autoindent', -1) - " #446 + " #758 setlocal cinkeys& setlocal indentkeys& let cinkeys = &l:cinkeys @@ -9915,14 +10079,14 @@ function! s:suite.blockwise_x_option_indentkeys() abort "{{{ call operator#sandwich#set('replace', 'block', 'indentkeys-', 'O,o') call setline('.', ' "foo"') execute "normal ^\2i\"sra" - call g:assert.equals(getline(1), ' {', 'failed at #446') - call g:assert.equals(getline(2), 'foo', 'failed at #446') - call g:assert.equals(getline(3), ' }', 'failed at #446') - " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #446') - " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #446') - " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #446') - call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #446') - call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #446') + call g:assert.equals(getline(1), ' {', 'failed at #758') + call g:assert.equals(getline(2), 'foo', 'failed at #758') + call g:assert.equals(getline(3), ' }', 'failed at #758') + " call g:assert.equals(getpos('.'), [0, 2, 1, 0], 'failed at #758') + " call g:assert.equals(getpos("'["), [0, 1, 9, 0], 'failed at #758') + " call g:assert.equals(getpos("']"), [0, 3, 6, 0], 'failed at #758') + call g:assert.equals(&l:cinkeys, cinkeys, 'failed at #758') + call g:assert.equals(&l:indentkeys, indentkeys, 'failed at #758') endfunction "}}} @@ -9934,29 +10098,29 @@ function! s:suite.function_interface() abort "{{{ \ {'buns': ['[', ']']}, \ ] - " #673 + " #759 call setline('.', '(foo)') normal 0sra([ - call g:assert.equals(getline('.'), '(foo)', 'failed at #673') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #673') + call g:assert.equals(getline('.'), '(foo)', 'failed at #759') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #759') - " #674 + " #760 call setline('.', '[foo]') normal 0sra[( - call g:assert.equals(getline('.'), '(foo(', 'failed at #674') - call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #674') + call g:assert.equals(getline('.'), '(foo(', 'failed at #760') + call g:assert.equals(getpos('.'), [0, 1, 2, 0], 'failed at #760') - " #675 + " #761 call setline('.', '(foo)') normal 0ssra([ - call g:assert.equals(getline('.'), '[foo[', 'failed at #675') - call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #675') + call g:assert.equals(getline('.'), '[foo[', 'failed at #761') + call g:assert.equals(getpos('.'), [0, 1, 4, 0], 'failed at #761') - " #676 + " #762 call setline('.', '[foo]') normal 0ssra[( - call g:assert.equals(getline('.'), '[foo]', 'failed at #676') - call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #676') + call g:assert.equals(getline('.'), '[foo]', 'failed at #762') + call g:assert.equals(getpos('.'), [0, 1, 1, 0], 'failed at #762') endfunction "}}}