Mercurial > vim
diff src/testdir/test_textformat.vim @ 26813:efa773bec478 v8.2.3935
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Commit: https://github.com/vim/vim/commit/5d20fbf2e79b96a39abbdadc486b656cdcc67ed6
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Dec 29 16:05:31 2021 +0000
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Problem: CTRL-U in Insert mode does not fix the indent.
Solution: Fix the indent when 'cindent' is set.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 29 Dec 2021 17:15:02 +0100 |
parents | f0fdd992cfb9 |
children | 0d798c7e1865 |
line wrap: on
line diff
--- a/src/testdir/test_textformat.vim +++ b/src/testdir/test_textformat.vim @@ -238,7 +238,7 @@ func Test_format_c_comment() END call assert_equal(expected, getline(1, '$')) - " Using "o" repeates the line comment, "O" does not. + " Using "o" repeats the line comment, "O" does not. %del let text =<< trim END nop; @@ -261,6 +261,21 @@ func Test_format_c_comment() END call assert_equal(expected, getline(1, '$')) + " Using CTRL-U after "o" fixes the indent + %del + let text =<< trim END + { + val = val; // This is a comment + END + call setline(1, text) + exe "normal! 2Go\<C-U>x\<Esc>" + let expected =<< trim END + { + val = val; // This is a comment + x + END + call assert_equal(expected, getline(1, '$')) + bwipe! endfunc