aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-01-31 15:44:54 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-01-31 15:44:54 +0800
commitf7801fe138d9677c9333650b4d5581489d4b0613 (patch)
tree66e433894bec49313494ef31508e3d5e236d548b /src/nvim/testdir
parentda3b04a9e07635bab9b0d67e9b16c62c1e59e004 (diff)
downloadrneovim-f7801fe138d9677c9333650b4d5581489d4b0613.tar.gz
rneovim-f7801fe138d9677c9333650b4d5581489d4b0613.tar.bz2
rneovim-f7801fe138d9677c9333650b4d5581489d4b0613.zip
vim-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. https://github.com/vim/vim/commit/5d20fbf2e79b96a39abbdadc486b656cdcc67ed6
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_textformat.vim17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim
index 5cebdef7f1..e1d155eba7 100644
--- a/src/nvim/testdir/test_textformat.vim
+++ b/src/nvim/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