mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-26 01:40:12 -05:00
terminal: add 'charset_designator' enum to make code more self-documenting
This commit also renames the term_set_single_shift_ascii_printer() function to term_single_shift(), since the former is overly verbose and not really even accurate.
This commit is contained in:
parent
3c609771c5
commit
e030a2ca08
3 changed files with 19 additions and 18 deletions
14
terminal.c
14
terminal.c
|
|
@ -1606,11 +1606,11 @@ term_reset(struct terminal *term, bool hard)
|
|||
term->bell_action_enabled = true;
|
||||
term->mouse_tracking = MOUSE_NONE;
|
||||
term->mouse_reporting = MOUSE_NORMAL;
|
||||
term->charsets.selected = 0;
|
||||
term->charsets.set[0] = CHARSET_ASCII;
|
||||
term->charsets.set[1] = CHARSET_ASCII;
|
||||
term->charsets.set[2] = CHARSET_ASCII;
|
||||
term->charsets.set[3] = CHARSET_ASCII;
|
||||
term->charsets.selected = G0;
|
||||
term->charsets.set[G0] = CHARSET_ASCII;
|
||||
term->charsets.set[G1] = CHARSET_ASCII;
|
||||
term->charsets.set[G2] = CHARSET_ASCII;
|
||||
term->charsets.set[G3] = CHARSET_ASCII;
|
||||
term->saved_charsets = term->charsets;
|
||||
tll_free_and_free(term->window_title_stack, free);
|
||||
term_set_window_title(term, term->conf->title);
|
||||
|
|
@ -2869,10 +2869,10 @@ term_update_ascii_printer(struct terminal *term)
|
|||
}
|
||||
|
||||
void
|
||||
term_set_single_shift_ascii_printer(struct terminal *term, int selected)
|
||||
term_single_shift(struct terminal *term, enum charset_designator idx)
|
||||
{
|
||||
term->charsets.saved = term->charsets.selected;
|
||||
term->charsets.selected = selected;
|
||||
term->charsets.selected = idx;
|
||||
term->ascii_printer = &ascii_printer_single_shift;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue