summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1337
blob: fb7429d86959d85cd1dd5b960b343bb4c7682d37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1337
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.1337
Problem:    Get empty text prop when splitting line just after text prop.
Solution:   Do not create an empty text prop at the start of the line.
Files:	    src/textprop.c, src/testdir/test_textprop.vim


*** ../vim-8.1.1336/src/textprop.c	2019-05-15 22:45:33.956067651 +0200
--- src/textprop.c	2019-05-17 11:04:54.930395439 +0200
***************
*** 1075,1081 ****
  	    ++prevprop.ga_len;
  	}
  
! 	if (prop.tp_col + prop.tp_len >= skipped && ga_grow(&nextprop, 1) == OK)
  	{
  	    p = ((textprop_T *)nextprop.ga_data) + nextprop.ga_len;
  	    *p = prop;
--- 1075,1083 ----
  	    ++prevprop.ga_len;
  	}
  
! 	// Only add the property to the next line if the length is bigger than
! 	// zero.
! 	if (prop.tp_col + prop.tp_len > skipped && ga_grow(&nextprop, 1) == OK)
  	{
  	    p = ((textprop_T *)nextprop.ga_data) + nextprop.ga_len;
  	    *p = prop;
*** ../vim-8.1.1336/src/testdir/test_textprop.vim	2019-05-15 22:45:33.956067651 +0200
--- src/testdir/test_textprop.vim	2019-05-17 11:06:53.442102403 +0200
***************
*** 316,331 ****
    call assert_equal(expected, prop_list(2))
    call DeletePropTypes()
  
!   " split just after first prop, empty prop and second prop move to next line
    let expected = SetupOneLine() " 'xonex xtwoxx'
    exe "normal 0fea\<CR>\<Esc>"
    call assert_equal('xone', getline(1))
    call assert_equal('x xtwoxx', getline(2))
    let exp_first = expected[0:0]
    call assert_equal(exp_first, prop_list(1))
!   let expected[0].col = 1
!   let expected[0].length = 0
!   let expected[1].col -= 4
    call assert_equal(expected, prop_list(2))
    call DeletePropTypes()
  
--- 316,330 ----
    call assert_equal(expected, prop_list(2))
    call DeletePropTypes()
  
!   " split just after first prop, second prop move to next line
    let expected = SetupOneLine() " 'xonex xtwoxx'
    exe "normal 0fea\<CR>\<Esc>"
    call assert_equal('xone', getline(1))
    call assert_equal('x xtwoxx', getline(2))
    let exp_first = expected[0:0]
    call assert_equal(exp_first, prop_list(1))
!   let expected = expected[1:1]
!   let expected[0].col -= 4
    call assert_equal(expected, prop_list(2))
    call DeletePropTypes()
  
*** ../vim-8.1.1336/src/version.c	2019-05-16 22:24:52.407017760 +0200
--- src/version.c	2019-05-17 11:08:05.421997669 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1337,
  /**/

-- 
This computer is so slow, it takes forever to execute and endless loop!

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///