summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0643
blob: b3f467ea32dc3abab4314a4e1a2a5cda52d13a94 (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0643
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.0643
Problem:    Computing byte offset wrong. (Bjorn Linse)
Solution:   Use the right variable for array index.
Files:	    src/memline.c, src/testdir/test_textprop.vim


*** ../vim-8.1.0642/src/memline.c	2018-12-26 22:57:37.978550895 +0100
--- src/memline.c	2018-12-26 23:41:19.484193715 +0100
***************
*** 5380,5386 ****
  	    // lengths.
  	    len = 0;
  	    for (i = start_idx; i <= idx; ++i)
! 		len += STRLEN((char_u *)dp + ((dp->db_index[idx]) & DB_INDEX_MASK)) + 1;
  	}
  	else
  #endif
--- 5380,5386 ----
  	    // lengths.
  	    len = 0;
  	    for (i = start_idx; i <= idx; ++i)
! 		len += STRLEN((char_u *)dp + ((dp->db_index[i]) & DB_INDEX_MASK)) + 1;
  	}
  	else
  #endif
*** ../vim-8.1.0642/src/testdir/test_textprop.vim	2018-12-26 01:08:56.344312939 +0100
--- src/testdir/test_textprop.vim	2018-12-26 23:39:15.261354947 +0100
***************
*** 229,239 ****
  func Test_prop_byteoff()
    call prop_type_add('comment', {'highlight': 'Directory'})
    new
!   call setline(1, ['line1', 'line2', ''])
    set ff=unix
!   call assert_equal(13, line2byte(3))
    call prop_add(1, 1, {'end_col': 3, 'type': 'comment'})
!   call assert_equal(13, line2byte(3))
  
    bwipe!
    call prop_type_delete('comment')
--- 229,239 ----
  func Test_prop_byteoff()
    call prop_type_add('comment', {'highlight': 'Directory'})
    new
!   call setline(1, ['line1', 'second line', ''])
    set ff=unix
!   call assert_equal(19, line2byte(3))
    call prop_add(1, 1, {'end_col': 3, 'type': 'comment'})
!   call assert_equal(19, line2byte(3))
  
    bwipe!
    call prop_type_delete('comment')
*** ../vim-8.1.0642/src/version.c	2018-12-26 22:57:37.978550895 +0100
--- src/version.c	2018-12-26 23:41:36.016040461 +0100
***************
*** 801,802 ****
--- 801,804 ----
  {   /* Add new patch number below this line */
+ /**/
+     643,
  /**/

-- 
"I don’t know how to make a screenshot" - Richard Stallman, July 2002
(when asked to send a screenshot of his desktop for unix.se)

 /// 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    ///