forked from aniani/vim
patch 8.2.2166: auto format doesn't work when deleting text
Problem: Auto format doesn't work when deleting text. Solution: Make "x" trigger auto format. (closes #7504)
This commit is contained in:
@@ -934,6 +934,18 @@ func Test_fo_a_w()
|
||||
call assert_equal('g uu uu ', getline(1)[-8:])
|
||||
call assert_equal(['uu. foo'], getline(2, '$'))
|
||||
|
||||
" using backspace or "x" triggers reformat
|
||||
call setline(1, ['1 2 3 4 5 ', '6 7 8 9'])
|
||||
set tw=10
|
||||
set fo=taw
|
||||
set bs=indent,eol,start
|
||||
exe "normal 1G4la\<BS>\<BS>\<Esc>"
|
||||
call assert_equal(['1 2 4 5 6 ', '7 8 9'], getline(1, 2))
|
||||
exe "normal f4xx"
|
||||
call assert_equal(['1 2 5 6 7 ', '8 9'], getline(1, 2))
|
||||
|
||||
set tw=0
|
||||
set fo&
|
||||
%bw!
|
||||
endfunc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user