summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0901
blob: e0f12ae13646731a30693ef8013385c0f6fdf866 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0901
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.0901
Problem:    Index in getjumplist() may be wrong. (Epheien)
Solution:   Call cleanup_jumplist() earlier. (Yegappan Lakshmanan,
            closes #3942)
Files:	    src/evalfunc.c, src/testdir/test_jumplist.vim


*** ../vim-8.1.0900/src/evalfunc.c	2019-02-11 22:00:07.667917634 +0100
--- src/evalfunc.c	2019-02-12 22:06:11.676133841 +0100
***************
*** 5271,5276 ****
--- 5271,5278 ----
      if (wp == NULL)
  	return;
  
+     cleanup_jumplist(wp, TRUE);
+ 
      l = list_alloc();
      if (l == NULL)
  	return;
***************
*** 5279,5286 ****
  	return;
      list_append_number(rettv->vval.v_list, (varnumber_T)wp->w_jumplistidx);
  
-     cleanup_jumplist(wp, TRUE);
- 
      for (i = 0; i < wp->w_jumplistlen; ++i)
      {
  	if (wp->w_jumplist[i].fmark.mark.lnum == 0)
--- 5281,5286 ----
*** ../vim-8.1.0900/src/testdir/test_jumplist.vim	2018-02-11 14:25:08.000000000 +0100
--- src/testdir/test_jumplist.vim	2019-02-12 22:08:59.458924694 +0100
***************
*** 28,38 ****
    normal G
    normal gg
  
!   call assert_equal([[
  	      \ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0},
  	      \ {'lnum': 50, 'bufnr': bnr, 'col': 0, 'coladd': 0},
! 	      \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 4],
! 	      \ getjumplist())
  
    " Traverse the jump list and verify the results
    5
--- 28,40 ----
    normal G
    normal gg
  
!   let expected = [[
  	      \ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0},
  	      \ {'lnum': 50, 'bufnr': bnr, 'col': 0, 'coladd': 0},
! 	      \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 3]
!   call assert_equal(expected, getjumplist())
!   " jumplist doesn't change in between calls
!   call assert_equal(expected, getjumplist())
  
    " Traverse the jump list and verify the results
    5
***************
*** 44,55 ****
    call assert_equal(3, getjumplist()[1])
    exe "normal \<C-O>"
    normal 20%
!   call assert_equal([[
  	      \ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0},
  	      \ {'lnum': 50, 'bufnr': bnr, 'col': 0, 'coladd': 0},
  	      \ {'lnum': 5, 'bufnr': bnr, 'col': 0, 'coladd': 0},
! 	      \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 5],
! 	      \ getjumplist())
  
    let l = getjumplist()
    call test_garbagecollect_now()
--- 46,59 ----
    call assert_equal(3, getjumplist()[1])
    exe "normal \<C-O>"
    normal 20%
!   let expected = [[
  	      \ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0},
  	      \ {'lnum': 50, 'bufnr': bnr, 'col': 0, 'coladd': 0},
  	      \ {'lnum': 5, 'bufnr': bnr, 'col': 0, 'coladd': 0},
! 	      \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 4]
!   call assert_equal(expected, getjumplist())
!   " jumplist doesn't change in between calls
!   call assert_equal(expected, getjumplist())
  
    let l = getjumplist()
    call test_garbagecollect_now()
*** ../vim-8.1.0900/src/version.c	2019-02-12 21:46:43.157342193 +0100
--- src/version.c	2019-02-12 22:14:55.153310642 +0100
***************
*** 785,786 ****
--- 785,788 ----
  {   /* Add new patch number below this line */
+ /**/
+     901,
  /**/

-- 
The most powerful force in the universe is gossip.

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