summaryrefslogtreecommitdiffstats
path: root/gvim/vim-7.2/7.2.164
blob: f10bd210f5bb69570694c51ef535633461f9378c (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
To: vim-dev@vim.org
Subject: Patch 7.2.164
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.164
Problem:    When 'showbreak' is set the size of the Visual block may be
	    reported wrong. (Eduardo Daudt Flach)
Solution:   Temporarily make 'sbr' empty.
Files:	    src/normal.c, src/ops.c


*** ../vim-7.2.163/src/normal.c	Sat Feb 21 20:27:00 2009
--- src/normal.c	Wed Apr 22 18:30:20 2009
***************
*** 3709,3721 ****
  #ifdef FEAT_VISUAL
      if (VIsual_active && !char_avail())
      {
! 	int		i = lt(VIsual, curwin->w_cursor);
  	long		lines;
  	colnr_T		leftcol, rightcol;
  	linenr_T	top, bot;
  
  	/* Show the size of the Visual area. */
! 	if (i)
  	{
  	    top = VIsual.lnum;
  	    bot = curwin->w_cursor.lnum;
--- 3709,3721 ----
  #ifdef FEAT_VISUAL
      if (VIsual_active && !char_avail())
      {
! 	int		cursor_bot = lt(VIsual, curwin->w_cursor);
  	long		lines;
  	colnr_T		leftcol, rightcol;
  	linenr_T	top, bot;
  
  	/* Show the size of the Visual area. */
! 	if (cursor_bot)
  	{
  	    top = VIsual.lnum;
  	    bot = curwin->w_cursor.lnum;
***************
*** 3734,3747 ****
  
  	if (VIsual_mode == Ctrl_V)
  	{
  	    getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol);
  	    sprintf((char *)showcmd_buf, "%ldx%ld", lines,
  					      (long)(rightcol - leftcol + 1));
  	}
  	else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum)
  	    sprintf((char *)showcmd_buf, "%ld", lines);
  	else
! 	    sprintf((char *)showcmd_buf, "%ld", (long)(i
  		    ? curwin->w_cursor.col - VIsual.col
  		    : VIsual.col - curwin->w_cursor.col) + (*p_sel != 'e'));
  	showcmd_buf[SHOWCMD_COLS] = NUL;	/* truncate */
--- 3734,3756 ----
  
  	if (VIsual_mode == Ctrl_V)
  	{
+ #ifdef FEAT_LINEBREAK
+ 	    char_u *saved_sbr = p_sbr;
+ 
+ 	    /* Make 'sbr' empty for a moment to get the correct size. */
+ 	    p_sbr = empty_option;
+ #endif
  	    getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol);
+ #ifdef FEAT_LINEBREAK
+ 	    p_sbr = saved_sbr;
+ #endif
  	    sprintf((char *)showcmd_buf, "%ldx%ld", lines,
  					      (long)(rightcol - leftcol + 1));
  	}
  	else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum)
  	    sprintf((char *)showcmd_buf, "%ld", lines);
  	else
! 	    sprintf((char *)showcmd_buf, "%ld", (long)(cursor_bot
  		    ? curwin->w_cursor.col - VIsual.col
  		    : VIsual.col - curwin->w_cursor.col) + (*p_sel != 'e'));
  	showcmd_buf[SHOWCMD_COLS] = NUL;	/* truncate */
*** ../vim-7.2.163/src/ops.c	Wed Apr 22 17:42:53 2009
--- src/ops.c	Wed Apr 22 18:30:07 2009
***************
*** 392,398 ****
      colnr_T		ws_vcol;
      int			i = 0, j = 0;
      int			len;
- 
  #ifdef FEAT_RIGHTLEFT
      int			old_p_ri = p_ri;
  
--- 392,397 ----
***************
*** 6284,6294 ****
--- 6283,6302 ----
  
  	    if (VIsual_mode == Ctrl_V)
  	    {
+ #ifdef FEAT_LINEBREAK
+ 		char_u * saved_sbr = p_sbr;
+ 
+ 		/* Make 'sbr' empty for a moment to get the correct size. */
+ 		p_sbr = empty_option;
+ #endif
  		oparg.is_VIsual = 1;
  		oparg.block_mode = TRUE;
  		oparg.op_type = OP_NOP;
  		getvcols(curwin, &min_pos, &max_pos,
  					  &oparg.start_vcol, &oparg.end_vcol);
+ #ifdef FEAT_LINEBREAK
+ 		p_sbr = saved_sbr;
+ #endif
  		if (curwin->w_curswant == MAXCOL)
  		    oparg.end_vcol = MAXCOL;
  		/* Swap the start, end vcol if needed */
*** ../vim-7.2.163/src/version.c	Wed Apr 29 12:03:35 2009
--- src/version.c	Wed Apr 29 17:38:05 2009
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     164,
  /**/

-- 
There are 10 kinds of people: Those who understand binary and those who don't.

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