Mercurial > vim
diff src/testdir/test_textformat.vim @ 15326:fe428bee74b3 v8.1.0671
patch 8.1.0671: cursor in the wrong column after auto-formatting
commit https://github.com/vim/vim/commit/e1e714ef0d1f4bb8b1712795e9106e3b4ff4c7bd
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 31 23:58:24 2018 +0100
patch 8.1.0671: cursor in the wrong column after auto-formatting
Problem: Cursor in the wrong column after auto-formatting.
Solution: Check for deleting more spaces than adding. (closes https://github.com/vim/vim/issues/3748)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 01 Jan 2019 00:00:07 +0100 |
parents | d9a94be389b5 |
children | 5ecac7734184 |
line wrap: on
line diff
--- a/src/testdir/test_textformat.vim +++ b/src/testdir/test_textformat.vim @@ -450,5 +450,16 @@ func Test_format_undo() \ ], getline(1, '$')) unmap gg + set tw& enew! endfunc + +func Test_format_list_auto() + new + call setline(1, ['1. abc', '2. def', '3. ghi']) + set fo=tan ai bs=2 + call feedkeys("3G0lli\<BS>\<BS>x\<Esc>", 'tx') + call assert_equal('2. defx ghi', getline(2)) + bwipe! + set fo& ai& bs& +endfunc