summaryrefslogtreecommitdiff
blob: b00a3c98aa1835d5c68a376c6589c6c60d9f49e9 (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
To: vim-dev@vim.org
Subject: Patch 6.0.068
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 6.0.068
Problem:    When formatting a Visually selected area with "gq" and the number
	    of lines increases the last line may not be redrawn correctly.
	    (Yegappan Lakshmanan)
Solution:   Correct the area to be redrawn for inserted/deleted lines.
Files:	    src/ops.c


*** ../vim60.67/src/ops.c	Wed Oct 31 20:51:33 2001
--- src/ops.c	Sat Nov  3 21:25:47 2001
***************
*** 4034,4043 ****
      if (oap->end_adjusted && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
  	++curwin->w_cursor.lnum;
      beginline(BL_WHITE | BL_FIX);
!     msgmore(curbuf->b_ml.ml_line_count - old_line_count);
  
      /* put '] mark on the end of the formatted area */
      curbuf->b_op_end = curwin->w_cursor;
  }
  
  /*
--- 4035,4065 ----
      if (oap->end_adjusted && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
  	++curwin->w_cursor.lnum;
      beginline(BL_WHITE | BL_FIX);
!     old_line_count = curbuf->b_ml.ml_line_count - old_line_count;
!     msgmore(old_line_count);
  
      /* put '] mark on the end of the formatted area */
      curbuf->b_op_end = curwin->w_cursor;
+ 
+ #ifdef FEAT_VISUAL
+     if (oap->is_VIsual)
+     {
+ 	win_T	*wp;
+ 
+ 	FOR_ALL_WINDOWS(wp)
+ 	{
+ 	    if (wp->w_old_cursor_lnum != 0)
+ 	    {
+ 		/* When lines have been inserted or deleted, adjust the end of
+ 		 * the Visual area to be redrawn. */
+ 		if (wp->w_old_cursor_lnum > wp->w_old_visual_lnum)
+ 		    wp->w_old_cursor_lnum += old_line_count;
+ 		else
+ 		    wp->w_old_visual_lnum += old_line_count;
+ 	    }
+ 	}
+     }
+ #endif
  }
  
  /*
*** ../vim60.67/src/version.c	Sat Nov  3 14:16:30 2001
--- src/version.c	Sat Nov  3 21:28:49 2001
***************
*** 608,609 ****
--- 608,611 ----
  {   /* Add new patch number below this line */
+ /**/
+     68,
  /**/

-- 
At some point in the project somebody will start whining about the need to
determine the project "requirements".  This involves interviewing people who
don't know what they want but, curiously, know exactly when they need it.
				(Scott Adams - The Dilbert principle)

 ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
 \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///