From 29bd788660af90855f6acce411506aeaf14f8808 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 8 Feb 2020 16:56:49 -0500 Subject: Simplify(?) reflow buffer loop --- ui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui.c b/ui.c index c738617..29062be 100644 --- a/ui.c +++ b/ui.c @@ -459,10 +459,12 @@ void uiFormat( static void reflow(struct Window *window) { werase(window->pad); wmove(window->pad, BufferCap - 1, 0); - size_t len = window->buffer.len; - for (size_t i = (len > BufferCap ? len - BufferCap : 0); i < len; ++i) { + struct Buffer *buffer = &window->buffer; + for (size_t i = 0; i < BufferCap; ++i) { + char *line = buffer->lines[(buffer->len + i) % BufferCap]; + if (!line) continue; waddch(window->pad, '\n'); - wordWrap(window->pad, window->buffer.lines[i % BufferCap]); + wordWrap(window->pad, line); } } -- cgit 1.4.1 ch'/> dontfiles
summary refs log tree commit diff
path: root/etc/Go-Mono-Italic.ttf (unfollow)
Commit message (Collapse)Author
2019-02-08Use X macros for hi classesJune McEnroe
2019-02-08Don't open folds when using {}June McEnroe
2019-02-08Add sh syntax to hiJune McEnroe
2019-02-08Use [] to quote special characters in regexJune McEnroe
This looks much cleaner than having to double-escape backslash.
2019-02-08Improve ANSI output and base IRC on itJune McEnroe
2019-02-08Add hi -nJune McEnroe
2019-02-08Elaborate hi man pageJune McEnroe
2019-02-08Use set for parent in hiJune McEnroe
2019-02-08Switch back to semantic keyword grouping in hiJune McEnroe
2019-02-08Match only the basename in hiJune McEnroe
2019-02-07Add mdoc syntax to hiJune McEnroe
2019-02-07Support multi-line C macros in hiJune McEnroe
2019-02-07Detect .mk files as makeJune McEnroe
2019-02-07Add make syntax to hiJune McEnroe
2019-02-07Add IRC output to hiJune McEnroe
2019-02-07Improve C syntax accuracy and add Format classJune McEnroe
2019-02-07Factor out hi checkJune McEnroe
Fix subexpression bounds check and compile pattends.
2019-02-07Add Escape class to hiJune McEnroe
2019-02-07Add Todo class and parent syntax constraintJune McEnroe