4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When 'showbreak' is set the size of the Visual block may be
12 reported wrong. (Eduardo Daudt Flach)
13 Solution: Temporarily make 'sbr' empty.
14 Files: src/normal.c, src/ops.c
17 *** ../vim-7.2.163/src/normal.c Sat Feb 21 20:27:00 2009
18 --- src/normal.c Wed Apr 22 18:30:20 2009
22 if (VIsual_active && !char_avail())
24 ! int i = lt(VIsual, curwin->w_cursor);
26 colnr_T leftcol, rightcol;
29 /* Show the size of the Visual area. */
33 bot = curwin->w_cursor.lnum;
36 if (VIsual_active && !char_avail())
38 ! int cursor_bot = lt(VIsual, curwin->w_cursor);
40 colnr_T leftcol, rightcol;
43 /* Show the size of the Visual area. */
47 bot = curwin->w_cursor.lnum;
51 if (VIsual_mode == Ctrl_V)
53 getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol);
54 sprintf((char *)showcmd_buf, "%ldx%ld", lines,
55 (long)(rightcol - leftcol + 1));
57 else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum)
58 sprintf((char *)showcmd_buf, "%ld", lines);
60 ! sprintf((char *)showcmd_buf, "%ld", (long)(i
61 ? curwin->w_cursor.col - VIsual.col
62 : VIsual.col - curwin->w_cursor.col) + (*p_sel != 'e'));
63 showcmd_buf[SHOWCMD_COLS] = NUL; /* truncate */
66 if (VIsual_mode == Ctrl_V)
68 + #ifdef FEAT_LINEBREAK
69 + char_u *saved_sbr = p_sbr;
71 + /* Make 'sbr' empty for a moment to get the correct size. */
72 + p_sbr = empty_option;
74 getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol);
75 + #ifdef FEAT_LINEBREAK
78 sprintf((char *)showcmd_buf, "%ldx%ld", lines,
79 (long)(rightcol - leftcol + 1));
81 else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum)
82 sprintf((char *)showcmd_buf, "%ld", lines);
84 ! sprintf((char *)showcmd_buf, "%ld", (long)(cursor_bot
85 ? curwin->w_cursor.col - VIsual.col
86 : VIsual.col - curwin->w_cursor.col) + (*p_sel != 'e'));
87 showcmd_buf[SHOWCMD_COLS] = NUL; /* truncate */
88 *** ../vim-7.2.163/src/ops.c Wed Apr 22 17:42:53 2009
89 --- src/ops.c Wed Apr 22 18:30:07 2009
104 if (VIsual_mode == Ctrl_V)
106 + #ifdef FEAT_LINEBREAK
107 + char_u * saved_sbr = p_sbr;
109 + /* Make 'sbr' empty for a moment to get the correct size. */
110 + p_sbr = empty_option;
113 oparg.block_mode = TRUE;
114 oparg.op_type = OP_NOP;
115 getvcols(curwin, &min_pos, &max_pos,
116 &oparg.start_vcol, &oparg.end_vcol);
117 + #ifdef FEAT_LINEBREAK
120 if (curwin->w_curswant == MAXCOL)
121 oparg.end_vcol = MAXCOL;
122 /* Swap the start, end vcol if needed */
123 *** ../vim-7.2.163/src/version.c Wed Apr 29 12:03:35 2009
124 --- src/version.c Wed Apr 29 17:38:05 2009
128 { /* Add new patch number below this line */
134 There are 10 kinds of people: Those who understand binary and those who don't.
136 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
137 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
138 \\\ download, build and distribute -- http://www.A-A-P.org ///
139 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///