diff options
Diffstat (limited to 'usr.bin/vim/screen.c')
-rw-r--r-- | usr.bin/vim/screen.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.bin/vim/screen.c b/usr.bin/vim/screen.c index 4ec3a82d9b5..dbf54324566 100644 --- a/usr.bin/vim/screen.c +++ b/usr.bin/vim/screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.c,v 1.1 1996/09/07 21:40:24 downsj Exp $ */ +/* $OpenBSD: screen.c,v 1.2 1996/09/21 06:23:18 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -2953,11 +2953,13 @@ screen_del_lines(off, row, line_count, end, force) * If clear_cmdline is TRUE, clear the rest of the cmdline. * If clear_cmdline is FALSE there may be a message there that needs to be * cleared only if a mode is shown. + * Return the lenght of the message (0 if no message). */ - void + int showmode() { int need_clear = FALSE; + int length = 0; int do_mode = (p_smd && ((State & INSERT) || restart_edit || VIsual_active)); @@ -3045,6 +3047,7 @@ showmode() if (need_clear || clear_cmdline) msg_clr_eos(); msg_didout = FALSE; /* overwrite this message */ + length = msg_col; msg_col = 0; } else if (clear_cmdline) /* just clear anything */ @@ -3055,6 +3058,8 @@ showmode() } win_redr_ruler(lastwin, TRUE); redraw_cmdline = FALSE; + + return length; } /* @@ -3224,7 +3229,7 @@ jump_to_mouse(flags) on_status_line = row - wp->w_height + 1; else on_status_line = 0; - win_enter(wp, TRUE); + win_enter(wp, TRUE); /* can make wp invalid! */ if (on_status_line) /* In (or below) status line */ { /* Don't use start_arrow() if we're in the same window */ @@ -3286,10 +3291,6 @@ jump_to_mouse(flags) col = Columns - 1 - col; #endif - if (curwin->w_p_nu) /* skip number in front of the line */ - if ((col -= 8) < 0) - col = 0; - if (curwin->w_p_wrap) /* lines wrap */ { while (row) @@ -3319,6 +3320,11 @@ jump_to_mouse(flags) } col += curwin->w_leftcol; } + + if (curwin->w_p_nu) /* skip number in front of the line */ + if ((col -= 8) < 0) + col = 0; + curwin->w_curswant = col; curwin->w_set_curswant = FALSE; /* May still have been TRUE */ if (coladvance(col) == FAIL) |