summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.2.078
blob: 0e127bc41fdb52652b0f55619ccc06b0829c12ab (about) (plain) (blame)
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
116
117
118
119
120
To: vim-dev@vim.org
Subject: Patch 7.2.078
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.078
Problem:    When deleting a fold that is specified with markers the cursor
	    position may be wrong.  Folds may not be displayed properly after
	    a delete.  Wrong fold may be deleted.
Solution:   Fix the problems. (mostly by Lech Lorens)
Files:	    src/fold.c


*** ../vim-7.2.077/src/fold.c	Fri Nov 28 21:26:50 2008
--- src/fold.c	Tue Jan  6 14:53:26 2009
***************
*** 740,746 ****
      garray_T	*found_ga;
      fold_T	*found_fp = NULL;
      linenr_T	found_off = 0;
!     int		use_level = FALSE;
      int		maybe_small = FALSE;
      int		level = 0;
      linenr_T	lnum = start;
--- 740,746 ----
      garray_T	*found_ga;
      fold_T	*found_fp = NULL;
      linenr_T	found_off = 0;
!     int		use_level;
      int		maybe_small = FALSE;
      int		level = 0;
      linenr_T	lnum = start;
***************
*** 757,762 ****
--- 757,763 ----
  	gap = &curwin->w_folds;
  	found_ga = NULL;
  	lnum_off = 0;
+ 	use_level = FALSE;
  	for (;;)
  	{
  	    if (!foldFind(gap, lnum - lnum_off, &fp))
***************
*** 783,802 ****
  	else
  	{
  	    lnum = found_fp->fd_top + found_fp->fd_len + found_off;
- 	    did_one = TRUE;
  
  	    if (foldmethodIsManual(curwin))
  		deleteFoldEntry(found_ga,
  		    (int)(found_fp - (fold_T *)found_ga->ga_data), recursive);
  	    else
  	    {
! 		if (found_fp->fd_top + found_off < first_lnum)
! 		    first_lnum = found_fp->fd_top;
! 		if (lnum > last_lnum)
  		    last_lnum = lnum;
! 		parseMarker(curwin);
  		deleteFoldMarkers(found_fp, recursive, found_off);
  	    }
  
  	    /* redraw window */
  	    changed_window_setting();
--- 784,804 ----
  	else
  	{
  	    lnum = found_fp->fd_top + found_fp->fd_len + found_off;
  
  	    if (foldmethodIsManual(curwin))
  		deleteFoldEntry(found_ga,
  		    (int)(found_fp - (fold_T *)found_ga->ga_data), recursive);
  	    else
  	    {
! 		if (first_lnum > found_fp->fd_top + found_off)
! 		    first_lnum = found_fp->fd_top + found_off;
! 		if (last_lnum < lnum)
  		    last_lnum = lnum;
! 		if (!did_one)
! 		    parseMarker(curwin);
  		deleteFoldMarkers(found_fp, recursive, found_off);
  	    }
+ 	    did_one = TRUE;
  
  	    /* redraw window */
  	    changed_window_setting();
***************
*** 811,816 ****
--- 813,822 ----
  	    redraw_curbuf_later(INVERTED);
  #endif
      }
+     else
+ 	/* Deleting markers may make cursor column invalid. */
+ 	check_cursor_col();
+ 
      if (last_lnum > 0)
  	changed_lines(first_lnum, (colnr_T)0, last_lnum, 0L);
  }
*** ../vim-7.2.077/src/version.c	Wed Dec 31 16:20:54 2008
--- src/version.c	Tue Jan  6 15:00:36 2009
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     78,
  /**/

-- 
Looking at Perl through Lisp glasses, Perl looks atrocious.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///