comparison src/testdir/test_join.vim @ 18599:9cbdd58eeeb2 v8.1.2293

patch 8.1.2293: join adds trailing space when second line is empty Commit: https://github.com/vim/vim/commit/cc184cfb09161b3bbc7d5d8859a18e812367d19c Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 12 20:31:20 2019 +0100 patch 8.1.2293: join adds trailing space when second line is empty Problem: Join adds trailing space when second line is empty. (Brennan Vincent) Solution: Do not add a trailing space.
author Bram Moolenaar <Bram@vim.org>
date Tue, 12 Nov 2019 20:45:04 +0100
parents 6990c1160ea5
children 4c0b420e7327
comparison
equal deleted inserted replaced
18598:8ad5734bb66b 18599:9cbdd58eeeb2
7 call assert_equal('one two', getline(1)) 7 call assert_equal('one two', getline(1))
8 %del 8 %del
9 call setline(1, ['one', 'two', 'three', 'four']) 9 call setline(1, ['one', 'two', 'three', 'four'])
10 normal 10J 10 normal 10J
11 call assert_equal('one two three four', getline(1)) 11 call assert_equal('one two three four', getline(1))
12
13 call setline(1, ['one', '', 'two'])
14 normal J
15 call assert_equal('one', getline(1))
16
17 call setline(1, ['one', ' ', 'two'])
18 normal J
19 call assert_equal('one', getline(1))
20
21 call setline(1, ['one', '', '', 'two'])
22 normal JJ
23 call assert_equal('one', getline(1))
24
25 call setline(1, ['one', ' ', ' ', 'two'])
26 normal JJ
27 call assert_equal('one', getline(1))
28
29 call setline(1, ['one', '', '', 'two'])
30 normal 2J
31 call assert_equal('one', getline(1))
32
12 quit! 33 quit!
13 endfunc 34 endfunc
14 35
15 " Tests for setting the '[,'] marks when joining lines. 36 " Tests for setting the '[,'] marks when joining lines.
16 func Test_join_marks() 37 func Test_join_marks()