right
setlocal norightleft
call assert_equal("Vim", getline(1))
- close!
+ bw!
endif
set tw&
normal %
call assert_equal(4, col('.'))
let &encoding = save_enc
- close!
+ bw!
endfunc
func Test_empty_matchpairs()
redraw!
normal gq
setl textwidth&
- close!
+ bw!
endfunc
" Test for 'n' flag in 'formatoptions' to format numbered lists
normal gggqG
call assert_equal([' 1) one two', ' three', ' four', ' 2) two'],
\ getline(1, '$'))
- close!
+ bw!
endfunc
" Test for 'formatlistpat' option
normal gggqG
call assert_equal([' - one', ' two', ' three', ' - two'],
\ getline(1, '$'))
- close!
+ bw!
endfunc
" Test for the 'b' and 'v' flags in 'formatoptions'
call feedkeys('Amore five', 'xt')
call assert_equal(['one two three fourmore', 'five'], getline(1, '$'))
- close!
+ bw!
endfunc
" Test for the '1' flag in 'formatoptions'. Don't wrap text after a one letter
call feedkeys('A a bird', 'xt')
call assert_equal(['one two three four', 'a bird'], getline(1, '$'))
- close!
+ bw!
endfunc
" Test for 'l' flag in 'formatoptions'. When starting insert mode, if a line
call feedkeys('A six', 'xt')
call assert_equal(['one two three four five six'], getline(1, '$'))
- close!
+ bw!
endfunc
" Test for the '2' flag in 'formatoptions'
call assert_equal(["\tfirst line of a",
\ "paragraph. second line of the",
\ "same paragraph. third line."], getline(1, '$'))
- close!
+ bw!
endfunc
" This was leaving the cursor after the end of a line. Complicated way to