]>
Commit | Line | Data |
---|---|---|
d22eaa71 ER |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.2.164 | |
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.164 | |
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 | |
15 | ||
16 | ||
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 | |
19 | *************** | |
20 | *** 3709,3721 **** | |
21 | #ifdef FEAT_VISUAL | |
22 | if (VIsual_active && !char_avail()) | |
23 | { | |
24 | ! int i = lt(VIsual, curwin->w_cursor); | |
25 | long lines; | |
26 | colnr_T leftcol, rightcol; | |
27 | linenr_T top, bot; | |
28 | ||
29 | /* Show the size of the Visual area. */ | |
30 | ! if (i) | |
31 | { | |
32 | top = VIsual.lnum; | |
33 | bot = curwin->w_cursor.lnum; | |
34 | --- 3709,3721 ---- | |
35 | #ifdef FEAT_VISUAL | |
36 | if (VIsual_active && !char_avail()) | |
37 | { | |
38 | ! int cursor_bot = lt(VIsual, curwin->w_cursor); | |
39 | long lines; | |
40 | colnr_T leftcol, rightcol; | |
41 | linenr_T top, bot; | |
42 | ||
43 | /* Show the size of the Visual area. */ | |
44 | ! if (cursor_bot) | |
45 | { | |
46 | top = VIsual.lnum; | |
47 | bot = curwin->w_cursor.lnum; | |
48 | *************** | |
49 | *** 3734,3747 **** | |
50 | ||
51 | if (VIsual_mode == Ctrl_V) | |
52 | { | |
53 | getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol); | |
54 | sprintf((char *)showcmd_buf, "%ldx%ld", lines, | |
55 | (long)(rightcol - leftcol + 1)); | |
56 | } | |
57 | else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum) | |
58 | sprintf((char *)showcmd_buf, "%ld", lines); | |
59 | else | |
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 */ | |
64 | --- 3734,3756 ---- | |
65 | ||
66 | if (VIsual_mode == Ctrl_V) | |
67 | { | |
68 | + #ifdef FEAT_LINEBREAK | |
69 | + char_u *saved_sbr = p_sbr; | |
70 | + | |
71 | + /* Make 'sbr' empty for a moment to get the correct size. */ | |
72 | + p_sbr = empty_option; | |
73 | + #endif | |
74 | getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol); | |
75 | + #ifdef FEAT_LINEBREAK | |
76 | + p_sbr = saved_sbr; | |
77 | + #endif | |
78 | sprintf((char *)showcmd_buf, "%ldx%ld", lines, | |
79 | (long)(rightcol - leftcol + 1)); | |
80 | } | |
81 | else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum) | |
82 | sprintf((char *)showcmd_buf, "%ld", lines); | |
83 | else | |
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 | |
90 | *************** | |
91 | *** 392,398 **** | |
92 | colnr_T ws_vcol; | |
93 | int i = 0, j = 0; | |
94 | int len; | |
95 | - | |
96 | #ifdef FEAT_RIGHTLEFT | |
97 | int old_p_ri = p_ri; | |
98 | ||
99 | --- 392,397 ---- | |
100 | *************** | |
101 | *** 6284,6294 **** | |
102 | --- 6283,6302 ---- | |
103 | ||
104 | if (VIsual_mode == Ctrl_V) | |
105 | { | |
106 | + #ifdef FEAT_LINEBREAK | |
107 | + char_u * saved_sbr = p_sbr; | |
108 | + | |
109 | + /* Make 'sbr' empty for a moment to get the correct size. */ | |
110 | + p_sbr = empty_option; | |
111 | + #endif | |
112 | oparg.is_VIsual = 1; | |
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 | |
118 | + p_sbr = saved_sbr; | |
119 | + #endif | |
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 | |
125 | *************** | |
126 | *** 678,679 **** | |
127 | --- 678,681 ---- | |
128 | { /* Add new patch number below this line */ | |
129 | + /**/ | |
130 | + 164, | |
131 | /**/ | |
132 | ||
133 | -- | |
134 | There are 10 kinds of people: Those who understand binary and those who don't. | |
135 | ||
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 /// |