Daniel Eklöf
6f2cffd8c0
vt: never call term_print() with a width <= 0
2020-07-16 08:04:12 +02:00
Daniel Eklöf
9508804b18
vt: ignore 0x7f (DEL) in ground state
...
This ensures *all* bytes mapped to action_print() have wcwidth == 1.
DEL has wcwidth == -1, and would thus have been ignored by
term_print() anwyway.
2020-07-16 08:01:37 +02:00
Daniel Eklöf
6183f7f64a
vt: utf8: handle multi-column spacer values correctly when combining
2020-07-16 07:41:51 +02:00
Daniel Eklöf
9eb9a3d8a5
Merge pull request 'limit font size to non-negative values'
...
Closes https://codeberg.org/dnkl/foot/issues/38
2020-07-15 11:38:13 +02:00
Max Hollmann
5ae45c3b45
added font-size limitting to changelog
2020-07-15 11:05:22 +02:00
Max Hollmann
54e2b0b005
limit font size to non-negative values
2020-07-15 09:53:13 +02:00
Daniel Eklöf
22e7131241
Revert "wiki: testing"
...
This reverts commit b2dec8db16 .
2020-07-15 09:40:47 +02:00
Daniel Eklöf
b2dec8db16
wiki: testing
2020-07-15 09:35:20 +02:00
Daniel Eklöf
bead6f36d6
selection: don't skip SPACER cells in the generic foreach()
...
As that breaks e.g. selection marking (SPACER cells didn't get
inverted when rendered).
Instead, skip them in extract_one() only. I.e. when copying text from
the grid.
2020-07-15 09:22:06 +02:00
Daniel Eklöf
540864521e
selection: row->dirty is a boolean
2020-07-15 09:21:39 +02:00
Daniel Eklöf
970a42a6dd
term: don't re-render last cursor cell if cursor was hidden
2020-07-15 08:21:41 +02:00
Daniel Eklöf
6b0b3ddccc
Merge branch 'multi-column-special-spacer-value'
2020-07-15 08:20:10 +02:00
Daniel Eklöf
2fa2c9fad4
term: print: don't pad with spacers if auto-margin is disabled
2020-07-15 08:04:51 +02:00
Daniel Eklöf
b0798ad0be
grid: reflow: use macro print_spacer() to insert multi-column character spacers
2020-07-14 20:29:59 +02:00
Daniel Eklöf
f962fb236e
term: copy current VT attributes to multi-column spacer cells
...
And refactor: break out spacer-writing code to a function, since we do
exactly the same thing in two places.
2020-07-14 20:24:52 +02:00
Daniel Eklöf
a2af13a126
selection: no need to try to detect multi-column chars at the end of the line
...
This is handled by the generic foreach() functions, which now simply
skips spacer cells.
2020-07-14 17:06:04 +02:00
Daniel Eklöf
9ea42ef226
grid: reflow: handle multi column character spacers
...
Ignore *old* cells containing spacers.
Pad new grid with spacers if a multi-column character doesn't fit at
the end of a line.
Insert spacers after a multi-column character.
2020-07-14 17:04:59 +02:00
Daniel Eklöf
6d7aba3ea0
term: print: linewrap + insert *before* inserting SPACERS
...
Otherwise we end up overwriting the character in the last column
2020-07-14 17:03:20 +02:00
Daniel Eklöf
df2927e088
term: print: write special value CELL_MULT_COL_SPACER to extra cells
...
When printing a multi-column character, write CELL_MULT_COL_SPACER
instead of '0' to both padding cells (when character doesn't fit at
the end of the line), and to the cells following the actual character.
2020-07-14 16:49:11 +02:00
Daniel Eklöf
5c99e8013b
term: rename COMB_CHARS_LO,HI -> CELL_COMB_CHARS_LO,HI
2020-07-14 16:41:57 +02:00
Daniel Eklöf
4cf7195695
selection: recognize empty padding cells in a forced linewrap
...
When printing a multi-column character at the end of the line, and it
doesn't fit, we currently insert a forced line-wrap. This means the
last character(s) on the previous line will be empty, followed by a
multi-column character in the first cell on the next line.
Without special code to handle this, the selection text extraction
code will insert a hard newline, since this is normally the correct
thing to do.
Add a TODO, to consider writing a special place holder value to these
padding cells.
2020-07-14 13:17:50 +02:00
Daniel Eklöf
3bc404b5a3
selection: foreach: don't call callback for trailing multi-character cells
2020-07-14 12:59:36 +02:00
Daniel Eklöf
7d134e6b1c
changelog: 'not' -> 'now'
2020-07-14 12:48:16 +02:00
Daniel Eklöf
3fd61fa120
grid: reflow: always emit *all* cells of a multi-column character
2020-07-14 12:15:25 +02:00
Daniel Eklöf
7480c1c06b
term: remove assert, as we're already checking for this in the loop condition
2020-07-14 12:07:12 +02:00
Daniel Eklöf
b035469a7f
term: print: manually increment cursor column
...
We know we're within bounds, and thus we don't need the extra overhead
of term_cursor_right().
2020-07-14 12:05:24 +02:00
Daniel Eklöf
466466c19e
grid: reflow: use width=1 for invalid characters
2020-07-14 12:03:10 +02:00
Daniel Eklöf
98ebb99be3
term: line-wrap: need to update grid->cur_row when we did *not* scroll
2020-07-14 12:01:00 +02:00
Daniel Eklöf
635698722e
changelog: prefix all C0 names with 'C0::'
2020-07-14 11:33:30 +02:00
Daniel Eklöf
6ea9d1246f
term: print: also require width > 1 when checking if we need to force-wrap or not
...
While this might seem like it would slow down things, it should in
fact help the compiler optimize: the "normal" code path, that prints
regular ASCII characters, always call term_print() with width == 1.
2020-07-14 11:26:14 +02:00
Daniel Eklöf
b8c7dfba5c
term: line-wrap: manually set cursor row+col
...
line-wrap is in the hot path, and term_cursor_down/left adds
additional checks that we don't need.
2020-07-14 11:25:06 +02:00
Daniel Eklöf
803c87bb65
grid: reflow: force line-wrap if a multi-column character does not fit on current line
2020-07-14 11:03:33 +02:00
Daniel Eklöf
9dc1d18241
term: print: force line-wrap if a multi-column character does not fit on current line
2020-07-14 10:58:57 +02:00
Daniel Eklöf
bc2fc778ae
csi: DECAWM: clear LCF
2020-07-14 10:54:53 +02:00
Daniel Eklöf
7fce1720d6
csi: IND+RI now clears LCF
2020-07-14 10:52:46 +02:00
Daniel Eklöf
6faa9955ba
term: print: manually increment cursor column for multi-column chars
...
There's nothing wrong with using term_cursor_right(), but it is
unnecessary since we already check for the end-of-line.
2020-07-14 10:51:22 +02:00
Daniel Eklöf
ca7ec13f3b
term: insert: move assert() after checking whether insert mode is enabled or not
2020-07-14 10:50:38 +02:00
Daniel Eklöf
01c3a2635d
term: linefeed: explicitly clear LCF
...
LF should always clear LCF. Previously, it was done implicitly in
term_cursor_down(). I.e it was cleared as long as the cursor wasn't at
the bottom of the scrolling region
2020-07-14 10:49:44 +02:00
Daniel Eklöf
cabcc615c1
vt: change HT (horizontal tab) to *not* clear LCF
...
According to the specification, HT **should** clear LCF. However,
nearly all emulators do not. In particular, XTerm doesn't. So we
follow suite.
2020-07-14 10:47:17 +02:00
Daniel Eklöf
bbce760ab0
term: line-wrap: use term_cursor_{down,left}
2020-07-14 10:08:57 +02:00
Daniel Eklöf
b9719673a1
term: rename term_formfeed() -> term_carriage_return()
2020-07-14 09:29:10 +02:00
Daniel Eklöf
7f7ab00e11
vt: implement C0::FF - processed in the same way as C0::LF
2020-07-14 09:18:52 +02:00
Daniel Eklöf
4849a16f37
vt: process C0::VT the same way we process C0::LF
...
Previously, C0::VT was implemented as a simple 'cursor down'. I.e. it
would behave as LF **until** it reached the bottom of the screen,
where instead of scrolling, it became a no-op.
See https://vt100.net/docs/vt102-ug/chapter5.html
2020-07-14 09:15:15 +02:00
Daniel Eklöf
7357bb54eb
vt: sort C0's in the switch statement, and use escaped character possible
2020-07-14 09:11:17 +02:00
Daniel Eklöf
21674ab382
input: keyboard: keymap: close(fd) on early-return when failing to mmap
2020-07-14 08:55:20 +02:00
Daniel Eklöf
0ed02e9676
input: keyboard: keymap: use xkb_keymap_new_from_buffer()
2020-07-14 08:52:42 +02:00
Daniel Eklöf
307eead987
input: keyboard: detect failure to mmap keymap
2020-07-14 08:52:11 +02:00
Daniel Eklöf
fa75e1646a
Merge branch 'merge-wl-surface-damage'
...
Closes #35
2020-07-14 08:35:47 +02:00
Daniel Eklöf
18827ebe0b
changelog: mention fix for 'too many wl_surface_damage_buffer()' calls
2020-07-13 15:10:03 +02:00
Daniel Eklöf
d169e96346
wayland: configure: do a regular resize instead of a force resize
...
The commit log says that was needed to get tiling in GNOME
working. However, I don't know *which* extension that was.
Force resizing in a configure event means we'll trash a perfectly
valid buffer on e.g. 'activated' state changes.
So, let's revert this for now, and if this breaks GNOME, let's try to
find another solution. If worse comes to worse, we can detect if we're
running under GNOME and do a force-resize then, but not on sane
compositors.
2020-07-13 15:01:27 +02:00