summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-04-29 15:41:40 +0000
committerBram Moolenaar <Bram@vim.org>2009-04-29 15:41:40 +0000
commit81d00078beecadbdfab3b0600149b85e5da16c99 (patch)
tree9e6d5a94a51bee4347cea97c27eb542d6996a1e7 /src/normal.c
parent876f6d7f3c38fb946b9c361d7e5d49f16f04eef2 (diff)
downloadvim-git-81d00078beecadbdfab3b0600149b85e5da16c99.tar.gz
updated for version 7.2-164v7.2.164
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/normal.c b/src/normal.c
index 324133047..326995e6d 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -3709,13 +3709,13 @@ clear_showcmd()
#ifdef FEAT_VISUAL
if (VIsual_active && !char_avail())
{
- int i = lt(VIsual, curwin->w_cursor);
+ 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 (i)
+ if (cursor_bot)
{
top = VIsual.lnum;
bot = curwin->w_cursor.lnum;
@@ -3734,14 +3734,23 @@ clear_showcmd()
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)(i
+ 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 */