From 76670b2fb145307c93f39ff859cfc7cb20c21ce9 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 26 Jan 2021 19:33:17 -0500 Subject: Factor out windowReflow --- ui.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ui.c b/ui.c index a0bee13..a43719c 100644 --- a/ui.c +++ b/ui.c @@ -597,15 +597,18 @@ void uiFormat( uiWrite(id, heat, time, buf); } +static void windowReflow(struct Window *window) { + window->unreadHard = bufferReflow( + window->buffer, COLS, window->thresh, window->unreadSoft + ); +} + static void resize(void) { statusUpdate(); wclear(main); wresize(main, MAIN_LINES, COLS); for (uint num = 0; num < windows.len; ++num) { - struct Window *window = windows.ptrs[num]; - window->unreadHard = bufferReflow( - window->buffer, COLS, window->thresh, window->unreadSoft - ); + windowReflow(windows.ptrs[num]); } windowUpdate(); } @@ -792,9 +795,7 @@ static void incThresh(struct Window *window, int n) { } else { window->thresh += n; } - window->unreadHard = bufferReflow( - window->buffer, COLS, window->thresh, window->unreadSoft - ); + windowReflow(window); windowUpdate(); statusUpdate(); } @@ -1065,9 +1066,7 @@ void uiLoad(const char *name) { readString(file, &buf, &cap); bufferPush(window->buffer, COLS, window->thresh, heat, time, buf); } - window->unreadHard = bufferReflow( - window->buffer, COLS, window->thresh, window->unreadSoft - ); + windowReflow(window); } urlLoad(file, version); -- cgit 1.4.1 mp;id=3b4ad30d9789e43d5f639f97fd4613b3edbf83fa&follow=1'>commit diff
path: root/irc.c (unfollow)
Commit message (Expand)Author
2022-02-19Reimplement tab completeJune McEnroe
2022-02-19Handle errors from editFn, etc.June McEnroe
2022-02-19Reimplement text macrosJune McEnroe
2022-02-19Factor out input handling to input.cJune McEnroe
2022-02-19Factor out window management to window.cJune McEnroe
2022-02-19Enable -Wmissing-prototypesJune McEnroe
2022-02-19Fix edit.[ch] license notice additional permissionsJune McEnroe
2022-02-19Run line editing testsJune McEnroe
2022-02-18Implement new line editing "library"June McEnroe
2022-02-18Simplify cursor positioning in inputJune McEnroe
2022-02-18Fix M-f orderingJune McEnroe
2022-02-12Move sandman build to scripts/MakefileJune McEnroe
2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe
2022-02-12Copy RPP defines from oconfigureJune McEnroe