comparison src/testdir/test_textformat.vim @ 28972:864fa5276e78 v8.2.5008

patch 8.2.5008: when 'formatoptions' contains "/" wrongly wrapping comment Commit: https://github.com/vim/vim/commit/7e667788150be617aeac42b0d668618ac33ab9da Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 23 13:10:48 2022 +0100 patch 8.2.5008: when 'formatoptions' contains "/" wrongly wrapping comment Problem: When 'formatoptions' contains "/" wrongly wrapping a long trailing comment. Solution: Pass the OPENLINE_FORMAT flag.
author Bram Moolenaar <Bram@vim.org>
date Mon, 23 May 2022 14:15:03 +0200
parents 7bbd859b2a48
children 5478246aa14b
comparison
equal deleted inserted replaced
28971:1aa8858686ea 28972:864fa5276e78
287 nop; 287 nop;
288 val = val; // This is a comment 288 val = val; // This is a comment
289 x 289 x
290 END 290 END
291 call assert_equal(expected, getline(1, '$')) 291 call assert_equal(expected, getline(1, '$'))
292
293 " Comment is formatted when it wraps
294 normal 2GA with some more text added
295 let expected =<< trim END
296 nop;
297 val = val; // This is a comment
298 // with some more text
299 // added
300 x
301 END
302 call assert_equal(expected, getline(1, '$'))
303
292 set fo-=/ 304 set fo-=/
293 305
294 " using 'indentexpr' instead of 'cindent' does not repeat a comment 306 " using 'indentexpr' instead of 'cindent' does not repeat a comment
295 setl nocindent indentexpr=2 307 setl nocindent indentexpr=2
296 3delete 308 %del
309 let text =<< trim END
310 nop;
311 val = val; // This is a comment
312 END
313 call setline(1, text)
297 normal 2Gox 314 normal 2Gox
298 let expected =<< trim END 315 let expected =<< trim END
299 nop; 316 nop;
300 val = val; // This is a comment 317 val = val; // This is a comment
301 x 318 x