summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0458
blob: 387a61192da7b4a6ee2b03afef45ec4df221d2ca (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0458
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.0458
Problem:    Ml_get error and crash when using "do".
Solution:   Adjust cursor position also when diffupdate is not needed.
            (Hirohito Higashi)
Files:	    src/diff.c, src/testdir/test_diffmode.vim


*** ../vim-8.1.0457/src/diff.c	2018-09-18 21:20:22.507148523 +0200
--- src/diff.c	2018-10-07 17:18:59.663334194 +0200
***************
*** 2848,2865 ****
  theend:
      diff_busy = FALSE;
      if (diff_need_update)
-     {
- 	diff_need_update = FALSE;
  	ex_diffupdate(NULL);
!     }
      else
      {
- 	// Check that the cursor is on a valid character and update it's
- 	// position.  When there were filler lines the topline has become
- 	// invalid.
- 	check_cursor();
- 	changed_line_abv_curs();
- 
  	// Also need to redraw the other buffers.
  	diff_redraw(FALSE);
  	apply_autocmds(EVENT_DIFFUPDATED, NULL, NULL, FALSE, curbuf);
--- 2848,2866 ----
  theend:
      diff_busy = FALSE;
      if (diff_need_update)
  	ex_diffupdate(NULL);
! 
!     // Check that the cursor is on a valid character and update it's
!     // position.  When there were filler lines the topline has become
!     // invalid.
!     check_cursor();
!     changed_line_abv_curs();
! 
!     if (diff_need_update)
! 	// redraw already done by ex_diffupdate()
! 	diff_need_update = FALSE;
      else
      {
  	// Also need to redraw the other buffers.
  	diff_redraw(FALSE);
  	apply_autocmds(EVENT_DIFFUPDATED, NULL, NULL, FALSE, curbuf);
*** ../vim-8.1.0457/src/testdir/test_diffmode.vim	2018-10-02 18:25:41.420867587 +0200
--- src/testdir/test_diffmode.vim	2018-10-07 17:14:16.980965139 +0200
***************
*** 277,282 ****
--- 277,304 ----
    %bwipe!
  endfunc
  
+ func Test_do_lastline()
+   e! one
+   call setline(1, ['1','2','3','4','5','6'])
+   diffthis
+ 
+   new two
+   call setline(1, ['2','4','5'])
+   diffthis
+ 
+   1
+   norm dp]c
+   norm dp]c
+   wincmd w
+   call assert_equal(4, line('$'))
+   norm G
+   norm do
+   call assert_equal(3, line('$'))
+ 
+   windo diffoff
+   %bwipe!
+ endfunc
+ 
  func Test_diffoff()
    enew!
    call setline(1, ['Two', 'Three'])
*** ../vim-8.1.0457/src/version.c	2018-10-07 15:49:50.819989002 +0200
--- src/version.c	2018-10-07 17:46:14.728013142 +0200
***************
*** 794,795 ****
--- 794,797 ----
  {   /* Add new patch number below this line */
+ /**/
+     458,
  /**/

-- 
"The question of whether computers can think is just like the question
of whether submarines can swim."      -- Edsger W. Dijkstra

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