To: vim-dev@vim.org Subject: patch 5.5.050 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.5.050 Problem: "z+" and "z^" commands are missing. Solution: Implemented "z+" and "z^". Files: src/normal.c, runtime/doc/scroll.txt, runtime/doc/index.txt *** ../vim-5.5.49/src/normal.c Sat Oct 2 16:00:01 1999 --- src/normal.c Sun Oct 31 13:40:06 1999 *************** *** 709,715 **** break; /* ! * Cursor motions */ case 'G': nv_goto(oap, ca.count0 == 0 ? (long)curbuf->b_ml.ml_line_count --- 709,715 ---- break; /* ! * 3. Cursor motions */ case 'G': nv_goto(oap, ca.count0 == 0 ? (long)curbuf->b_ml.ml_line_count *************** *** 3411,3432 **** switch (nchar) { ! case NL: /* put curwin->w_cursor at top of screen */ case CR: beginline(BL_WHITE | BL_FIX); /* FALLTHROUGH */ case 't': scroll_cursor_top(0, TRUE); break; ! case '.': /* put curwin->w_cursor in middle of screen */ beginline(BL_WHITE | BL_FIX); /* FALLTHROUGH */ case 'z': scroll_cursor_halfway(TRUE); break; ! case '-': /* put curwin->w_cursor at bottom of screen */ beginline(BL_WHITE | BL_FIX); /* FALLTHROUGH */ case 'b': --- 3411,3463 ---- switch (nchar) { ! /* put cursor at top of screen */ ! case '+': ! case K_KPLUS: ! if (cap->count0 == 0) ! { ! /* No count given: put cursor at the line below screen */ ! validate_botline(); /* using w_botline, make sure it's valid */ ! if (curwin->w_botline > curbuf->b_ml.ml_line_count) ! curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; ! else ! curwin->w_cursor.lnum = curwin->w_botline; ! } ! /* FALLTHROUGH */ ! case NL: case CR: + case K_KENTER: beginline(BL_WHITE | BL_FIX); /* FALLTHROUGH */ case 't': scroll_cursor_top(0, TRUE); break; ! /* put cursor in middle of screen */ ! case '.': beginline(BL_WHITE | BL_FIX); /* FALLTHROUGH */ case 'z': scroll_cursor_halfway(TRUE); break; ! /* put cursor at bottom of screen */ ! case '^': ! /* Strange Vi behavior: z^ finds line at top of window when ! * is at bottom of window, and puts that one at bottom of ! * window. */ ! if (cap->count0 != 0) ! { ! scroll_cursor_bot(0, TRUE); ! curwin->w_cursor.lnum = curwin->w_topline; ! } ! else if (curwin->w_topline == 1) ! curwin->w_cursor.lnum = 1; ! else ! curwin->w_cursor.lnum = curwin->w_topline - 1; ! /* FALLTHROUGH */ ! case '-': ! case K_KMINUS: beginline(BL_WHITE | BL_FIX); /* FALLTHROUGH */ case 'b': *** ../vim-5.5.49/runtime/doc/scroll.txt Wed Sep 22 10:06:42 1999 --- runtime/doc/scroll.txt Sun Oct 31 13:38:08 1999 *************** *** 1,4 **** ! *scroll.txt* For Vim version 5.5. Last change: 1999 Sep 19 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *scroll.txt* For Vim version 5.5. Last change: 1999 Oct 31 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 95,100 **** --- 95,106 ---- zt Like "z", but leave the cursor in the same column. {not in Vi} + *z+* + z+ Without [count]: Redraw with the line just above the + window at the bottom of the window. Put the cursor in + that line, at the first non-blank in the line. + With [count]: just like "z". + *zN* z{height} Redraw, make window {height} lines tall. This is useful to make the number of lines small when screen *************** *** 120,125 **** --- 126,141 ---- zb Like "z-", but leave the cursor in the same column. {not in Vi} + *z^* + z^ Without [count]: Redraw with the line just above the + window at the bottom of the window. Put the cursor in + that line, at the first non-blank in the line. + With [count]: First scroll the text to put the [count] + line at the bottom of the window, then redraw with the + line which is now at the top of the window at the + bottom of the window. Put the cursor in that line, at + the first non-blank in the line. + ============================================================================== 4. Scrolling horizontally *scroll-horizontal* *** ../vim-5.5.49/runtime/doc/index.txt Wed Sep 22 10:06:41 1999 --- runtime/doc/index.txt Sun Oct 31 13:07:07 1999 *************** *** 1,4 **** ! *index.txt* For Vim version 5.5. Last change: 1999 Sep 14 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *index.txt* For Vim version 5.5. Last change: 1999 Oct 31 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 372,381 **** |z| z redraw, cursor line to top of window, cursor on first non-blank |zN| z{height} redraw, make window {height} lines high ! |z.| z. redraw, cursor line to center of window, ! cursor on first non-blank |z-| z- redraw, cursor line at bottom of window, cursor on first non-blank |zb| zb redraw, cursor line at bottom of window |ze| ze when 'wrap' off scroll horizontally to position the cursor at the end (right side) --- 372,385 ---- |z| z redraw, cursor line to top of window, cursor on first non-blank |zN| z{height} redraw, make window {height} lines high ! |z+| z+ cursor on line N (default line below ! window), otherwise like "z" |z-| z- redraw, cursor line at bottom of window, cursor on first non-blank + |z.| z. redraw, cursor line to center of window, + cursor on first non-blank + |z^| z^ cursor on line N (default line above + window), otherwise like "z-" |zb| zb redraw, cursor line at bottom of window |ze| ze when 'wrap' off scroll horizontally to position the cursor at the end (right side) *** ../vim-5.5.49/src/version.c Sat Dec 4 14:46:04 1999 --- src/version.c Sat Dec 4 14:47:46 1999 *************** *** 420,420 **** --- 420,421 ---- { /* Add new patch number below this line */ + 50, -- hundred-and-one symptoms of being an internet addict: 235. You start naming your kids Fortran, COBOL, Algol, and Pascal. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /