=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/vim/Attic/screen.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/usr.bin/vim/Attic/screen.c 1996/09/07 21:40:24 1.1 +++ src/usr.bin/vim/Attic/screen.c 1996/09/21 06:23:18 1.2 @@ -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 @@ * 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 @@ 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 @@ } win_redr_ruler(lastwin, TRUE); redraw_cmdline = FALSE; + + return length; } /* @@ -3224,7 +3229,7 @@ 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 @@ 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 @@ } 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)