]> git.pld-linux.org Git - packages/vim.git/blob - 7.2.078
- new
[packages/vim.git] / 7.2.078
1 To: vim-dev@vim.org
2 Subject: Patch 7.2.078
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.2.078
11 Problem:    When deleting a fold that is specified with markers the cursor
12             position may be wrong.  Folds may not be displayed properly after
13             a delete.  Wrong fold may be deleted.
14 Solution:   Fix the problems. (mostly by Lech Lorens)
15 Files:      src/fold.c
16
17
18 *** ../vim-7.2.077/src/fold.c   Fri Nov 28 21:26:50 2008
19 --- src/fold.c  Tue Jan  6 14:53:26 2009
20 ***************
21 *** 740,746 ****
22       garray_T  *found_ga;
23       fold_T    *found_fp = NULL;
24       linenr_T  found_off = 0;
25 !     int               use_level = FALSE;
26       int               maybe_small = FALSE;
27       int               level = 0;
28       linenr_T  lnum = start;
29 --- 740,746 ----
30       garray_T  *found_ga;
31       fold_T    *found_fp = NULL;
32       linenr_T  found_off = 0;
33 !     int               use_level;
34       int               maybe_small = FALSE;
35       int               level = 0;
36       linenr_T  lnum = start;
37 ***************
38 *** 757,762 ****
39 --- 757,763 ----
40         gap = &curwin->w_folds;
41         found_ga = NULL;
42         lnum_off = 0;
43 +       use_level = FALSE;
44         for (;;)
45         {
46             if (!foldFind(gap, lnum - lnum_off, &fp))
47 ***************
48 *** 783,802 ****
49         else
50         {
51             lnum = found_fp->fd_top + found_fp->fd_len + found_off;
52 -           did_one = TRUE;
53   
54             if (foldmethodIsManual(curwin))
55                 deleteFoldEntry(found_ga,
56                     (int)(found_fp - (fold_T *)found_ga->ga_data), recursive);
57             else
58             {
59 !               if (found_fp->fd_top + found_off < first_lnum)
60 !                   first_lnum = found_fp->fd_top;
61 !               if (lnum > last_lnum)
62                     last_lnum = lnum;
63 !               parseMarker(curwin);
64                 deleteFoldMarkers(found_fp, recursive, found_off);
65             }
66   
67             /* redraw window */
68             changed_window_setting();
69 --- 784,804 ----
70         else
71         {
72             lnum = found_fp->fd_top + found_fp->fd_len + found_off;
73   
74             if (foldmethodIsManual(curwin))
75                 deleteFoldEntry(found_ga,
76                     (int)(found_fp - (fold_T *)found_ga->ga_data), recursive);
77             else
78             {
79 !               if (first_lnum > found_fp->fd_top + found_off)
80 !                   first_lnum = found_fp->fd_top + found_off;
81 !               if (last_lnum < lnum)
82                     last_lnum = lnum;
83 !               if (!did_one)
84 !                   parseMarker(curwin);
85                 deleteFoldMarkers(found_fp, recursive, found_off);
86             }
87 +           did_one = TRUE;
88   
89             /* redraw window */
90             changed_window_setting();
91 ***************
92 *** 811,816 ****
93 --- 813,822 ----
94             redraw_curbuf_later(INVERTED);
95   #endif
96       }
97 +     else
98 +       /* Deleting markers may make cursor column invalid. */
99 +       check_cursor_col();
100
101       if (last_lnum > 0)
102         changed_lines(first_lnum, (colnr_T)0, last_lnum, 0L);
103   }
104 *** ../vim-7.2.077/src/version.c        Wed Dec 31 16:20:54 2008
105 --- src/version.c       Tue Jan  6 15:00:36 2009
106 ***************
107 *** 678,679 ****
108 --- 678,681 ----
109   {   /* Add new patch number below this line */
110 + /**/
111 +     78,
112   /**/
113
114 -- 
115 Looking at Perl through Lisp glasses, Perl looks atrocious.
116
117  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
118 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
119 \\\        download, build and distribute -- http://www.A-A-P.org        ///
120  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.03516 seconds and 3 git commands to generate.