Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
26812:4545b6dd8210 | 26813:efa773bec478 |
---|---|
236 // end of line comment | 236 // end of line comment |
237 // that wraps. | 237 // that wraps. |
238 END | 238 END |
239 call assert_equal(expected, getline(1, '$')) | 239 call assert_equal(expected, getline(1, '$')) |
240 | 240 |
241 " Using "o" repeates the line comment, "O" does not. | 241 " Using "o" repeats the line comment, "O" does not. |
242 %del | 242 %del |
243 let text =<< trim END | 243 let text =<< trim END |
244 nop; | 244 nop; |
245 val = val; // This is a comment | 245 val = val; // This is a comment |
246 END | 246 END |
256 let expected =<< trim END | 256 let expected =<< trim END |
257 nop; | 257 nop; |
258 | 258 |
259 val = val; // This is a comment | 259 val = val; // This is a comment |
260 // | 260 // |
261 END | |
262 call assert_equal(expected, getline(1, '$')) | |
263 | |
264 " Using CTRL-U after "o" fixes the indent | |
265 %del | |
266 let text =<< trim END | |
267 { | |
268 val = val; // This is a comment | |
269 END | |
270 call setline(1, text) | |
271 exe "normal! 2Go\<C-U>x\<Esc>" | |
272 let expected =<< trim END | |
273 { | |
274 val = val; // This is a comment | |
275 x | |
261 END | 276 END |
262 call assert_equal(expected, getline(1, '$')) | 277 call assert_equal(expected, getline(1, '$')) |
263 | 278 |
264 bwipe! | 279 bwipe! |
265 endfunc | 280 endfunc |