mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
vt: add branch hinting to PRINT action
This commit is contained in:
parent
77e349d20d
commit
00c5b27bfa
2 changed files with 6 additions and 3 deletions
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#include "tllist.h"
|
||||
|
||||
#define likely(c) __builtin_expect(!!(c), 1)
|
||||
#define unlikely(c) __builtin_expect(!!(c), 0)
|
||||
|
||||
struct wayland {
|
||||
struct wl_display *display;
|
||||
struct wl_registry *registry;
|
||||
|
|
|
|||
6
vt.c
6
vt.c
|
|
@ -698,7 +698,7 @@ action(struct terminal *term, enum action action, uint8_t c)
|
|||
break;
|
||||
|
||||
case ACTION_PRINT: {
|
||||
if (term->auto_margin && term->print_needs_wrap) {
|
||||
if (unlikely(term->print_needs_wrap) && term->auto_margin) {
|
||||
if (term->cursor.row == term->scroll_region.end - 1) {
|
||||
term_scroll(term, 1);
|
||||
term_cursor_to(term, term->cursor.row, 0);
|
||||
|
|
@ -709,7 +709,7 @@ action(struct terminal *term, enum action action, uint8_t c)
|
|||
struct cell *cell = &term->grid->cur_line[term->cursor.col];
|
||||
term_damage_update(term, term->cursor.linear, 1);
|
||||
|
||||
if (term->insert_mode) {
|
||||
if (unlikely(term->insert_mode)) {
|
||||
assert(false && "untested");
|
||||
grid_memmove(
|
||||
term->grid, term->cursor.linear + 1, term->cursor.linear,
|
||||
|
|
@ -735,7 +735,7 @@ action(struct terminal *term, enum action action, uint8_t c)
|
|||
"│", "≤", "≥", "π", "≠", "£", "·", /* x - ~ */
|
||||
};
|
||||
|
||||
if (term->charset[term->selected_charset] == CHARSET_GRAPHIC &&
|
||||
if (unlikely(term->charset[term->selected_charset] == CHARSET_GRAPHIC) &&
|
||||
c >= 0x41 && c <= 0x7e)
|
||||
{
|
||||
strcpy(cell->c, vt100_0[c - 0x41]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue