diff options
author | C. McEnroe | 2020-02-17 11:57:29 -0500 |
---|---|---|
committer | C. McEnroe | 2020-02-17 11:57:29 -0500 |
commit | cf83e95114eafc1fc357c68cfedc661482992ac1 (patch) | |
tree | 1c12fd321c0e288aeae25ab0dbf71567654a86e2 /ui.c | |
parent | fa29c3791119d9fafac1509d43e8da22c31cda6d (diff) |
Only scroll after reflow if necessary
If we've already filled up every line of the window, there is no need to scroll.
Diffstat (limited to 'ui.c')
-rw-r--r-- | ui.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui.c b/ui.c index 938eda6..84a0d9c 100644 --- a/ui.c +++ b/ui.c @@ -634,8 +634,10 @@ static void reflow(struct Window *window) { } flowed += lines; } - wscrl(window->pad, -(WindowLines - 1 - flowed)); - wmove(window->pad, WindowLines - 1, RIGHT); + if (flowed < WindowLines) { + wscrl(window->pad, -(WindowLines - 1 - flowed)); + wmove(window->pad, WindowLines - 1, RIGHT); + } } static void resize(void) { |