Commit Graph

20 Commits (86a0594cd2a934c1222d45ee69376a8c21426f1c)

Author SHA1 Message Date
C. McEnroe 52c58128c8 Add numbers to buffer lines
This directly correlates hard-wrapped lines with the soft lines
they were wrapped from.

Choosing uint here because it doesn't change the size of struct
Line. It doesn't at all matter since buffers only hold 1024 lines
at a time anyway.
2021-01-26 22:14:12 -05:00
C. McEnroe 609c9bd0ac Do not copy time to wrapped lines 2021-01-25 17:23:17 -05:00
C. McEnroe bc29082f9d Remove use of "%n" to appease de Raadt
Sure, it was completely unnecessary, but I resent being told how
to use snprintf.

https://cvsweb.openbsd.org/src/lib/libc/stdio/vfprintf.c?rev=1.79&content-type=text/x-cvsweb-markup
2021-01-23 12:34:30 -05:00
C. McEnroe d05872303e Generalize ignore toggling to visibility threshold 2021-01-16 12:58:16 -05:00
C. McEnroe bf70fcbfed Count width of 2 for invalid multibyte with high bit 2021-01-09 17:28:42 -05:00
C. McEnroe 3b54425ec1 Collapse whitespace while wrapping and discard trailing space
The latter avoids an extra blank line when a message ends with
whitespace that hits the edge of the window.
2021-01-04 14:28:37 -05:00
C. McEnroe 53f23942a4 Clear wrapping point at alignment tab
This fixes odd wrapping when a nick contains a hyphen and there are no
further wrapping points.
2020-10-09 22:52:44 -04:00
C. McEnroe b2de129e3f Copy style from wrapping point
This fixes a bug when wrapping on a word with style changes inside it,
where the copied style would be different depending on the width of the
terminal.
2020-09-11 19:12:42 -04:00
C. McEnroe 9513542c6d Include DEL in characters ncurses will print in ^A form 2020-09-08 14:54:51 -04:00
C. McEnroe 172d01a668 Let wrapped lines use the last column 2020-09-07 17:51:09 -04:00
C. McEnroe 05f94f1b8b Handle non-alignment tabs in line wrapping 2020-09-06 22:43:50 -04:00
C. McEnroe 0968a8ac7c Recalculate unreadHard on reflow 2020-09-02 21:29:03 -04:00
C. McEnroe 96386adac3 Hide ignored messages at the soft -> hard buffer layer
This restores normal scrolling behaviour.
2020-09-02 18:51:07 -04:00
C. McEnroe 16737d4edc Preserve style after alignment
This makes wrapping text with background colour look much better.
2020-09-02 17:08:21 -04:00
C. McEnroe d00b3d3b70 Actually insert blank lines in the soft buffer
So they can be preserved forever!
2020-09-02 16:29:38 -04:00
C. McEnroe 1563eb7d56 Don't consider the alignment tab a wrapping point 2020-09-02 15:48:47 -04:00
C. McEnroe a84c9cdda7 Fix line wrapping in various ways
Never split a codepoint, don't set wrapping point unless we're not
already wrapping, wrap on any unicode whitespace, only clear rest of
line if still on the same line...
2020-09-02 01:57:51 -04:00
C. McEnroe 149cafc5ab Render one main window from buffers
Still missing: split scrolling and preserving a blank on reflow either
from resize or ignore toggling.

Anecdata: on one of my instances of catgirl, RAM usage of the previous
release was ~30M, RAM usage of this commit was ~12M.
2020-09-02 00:27:16 -04:00
C. McEnroe 4dc87ab9cd Implement buffer line wrapping
Not yet rendered in the UI! Just done in parallel.
2020-09-01 22:54:26 -04:00
C. McEnroe ded2b6afb6 Factor buffer out of ui
In preparation for doing line wrapping outside of ncurses.
2020-09-01 20:36:50 -04:00