=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/tty.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- src/usr.bin/mg/tty.c 2015/03/19 21:48:05 1.35 +++ src/usr.bin/mg/tty.c 2015/11/18 18:44:50 1.36 @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.35 2015/03/19 21:48:05 bcallah Exp $ */ +/* $OpenBSD: tty.c,v 1.36 2015/11/18 18:44:50 jasper Exp $ */ /* This file is in the public domain. */ @@ -240,14 +240,14 @@ { int i, nl; - /* Case of one line insert is special. */ + /* One line special cases */ if (row == bot) { ttmove(row, 0); tteeol(); return; } + /* Use scroll region and back index */ if (change_scroll_region && scroll_reverse) { - /* Use scroll region and back index */ nl = bot - row; ttwindow(row, bot); ttmove(row, 0); @@ -255,13 +255,14 @@ putpad(scroll_reverse, nl); ttnowindow(); return; + /* else use insert/delete line */ } else if (insdel) { ttmove(1 + bot - nchunk, 0); nl = nrow - ttrow; if (parm_delete_line) putpad(tgoto(parm_delete_line, 0, nchunk), nl); else - /* For all lines in the chunk... */ + /* For all lines in the chunk */ for (i = 0; i < nchunk; i++) putpad(delete_line, nl); ttmove(row, 0); @@ -313,13 +314,14 @@ if (parm_delete_line) putpad(tgoto(parm_delete_line, 0, nchunk), nl); else - /* For all lines in the chunk */ + /* For all lines in the chunk */ for (i = 0; i < nchunk; i++) putpad(delete_line, nl); ttmove(1 + bot - nchunk, 0); /* ttmove() changes ttrow */ nl = nrow - ttrow; + if (parm_insert_line) putpad(tgoto(parm_insert_line, 0, nchunk), nl); else