Mercurial > vim
comparison src/testdir/test_textformat.vim @ 27599:044a12908236 v8.2.4326
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Commit: https://github.com/vim/vim/commit/51ab7c7d0da08aac796acff22a6c075dac579e76
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue Feb 8 12:58:37 2022 +0000
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Problem: "o" and "O" copying comment not sufficiently tested.
Solution: Add a test case. (closes https://github.com/vim/vim/issues/9718)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 08 Feb 2022 14:00:04 +0100 |
parents | 0d798c7e1865 |
children | ef62a0ea2a78 |
comparison
equal
deleted
inserted
replaced
27598:265ca21ac8a4 | 27599:044a12908236 |
---|---|
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" repeats the line comment, "O" does not. | 241 " Using either "o" or "O" repeats a line comment occupying a whole line. |
242 %del | |
243 let text =<< trim END | |
244 nop; | |
245 // This is a comment | |
246 val = val; | |
247 END | |
248 call setline(1, text) | |
249 normal 2Go | |
250 let expected =<< trim END | |
251 nop; | |
252 // This is a comment | |
253 // | |
254 val = val; | |
255 END | |
256 call assert_equal(expected, getline(1, '$')) | |
257 normal 2GO | |
258 let expected =<< trim END | |
259 nop; | |
260 // | |
261 // This is a comment | |
262 // | |
263 val = val; | |
264 END | |
265 call assert_equal(expected, getline(1, '$')) | |
266 | |
267 " Using "o" repeats a line comment after a statement, "O" does not. | |
242 %del | 268 %del |
243 let text =<< trim END | 269 let text =<< trim END |
244 nop; | 270 nop; |
245 val = val; // This is a comment | 271 val = val; // This is a comment |
246 END | 272 END |