diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-25 23:02:52 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-25 23:02:52 -0700 |
commit | fedad1f30832e6b92ac87aaa39758758e783ceb7 (patch) | |
tree | 80fee79b9e2c3fc77ede678668c7187cd438d8db | |
parent | a027ce3bf46727889ec14c396f57fec30496bf47 (diff) | |
download | txr-fedad1f30832e6b92ac87aaa39758758e783ceb7.tar.gz txr-fedad1f30832e6b92ac87aaa39758758e783ceb7.tar.bz2 txr-fedad1f30832e6b92ac87aaa39758758e783ceb7.zip |
linenoise: no wasteful retrace on clear screen.
* linenoise/linenoise.c (lino_clear_screen): Set
l->maxrows to zero so that refresh_multiline won't emit
useless upward cursor movement sequences. These have nowhere
to go from the top line of the screen.
-rw-r--r-- | linenoise/linenoise.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index a48ad4d1..e50eed2e 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -269,6 +269,7 @@ failed: /* Clear the screen. Used to handle ctrl+l */ int lino_clear_screen(lino_t *ls) { + ls->maxrows = 0; return (write(ls->ofd,"\x1b[H\x1b[2J",7) > 0); } |