diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-01-25 22:53:48 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-01-25 22:53:48 -0500 |
commit | 3df4d06fd663bf19f08343b0d77c20672301b9b2 (patch) | |
tree | ca68bbcd8a69798cfd1f76ebbbd2af7b86ce357f /src | |
parent | 4769d154e2c11031fdba4974815d070cf70cb936 (diff) | |
download | runes-3df4d06fd663bf19f08343b0d77c20672301b9b2.tar.gz runes-3df4d06fd663bf19f08343b0d77c20672301b9b2.zip |
make wide emoji configurable
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 3 | ||||
-rw-r--r-- | src/config.h | 1 | ||||
-rw-r--r-- | src/term.c | 2 | ||||
-rw-r--r-- | src/window-xlib.c | 2 |
4 files changed, 7 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index 31c4038..961e27e 100644 --- a/src/config.c +++ b/src/config.c @@ -449,6 +449,9 @@ static void runes_config_set(RunesConfig *config, char *key, char *val) else if (!strcmp(key, "bell_is_urgent")) { config->bell_is_urgent = runes_config_parse_bool(val); } + else if (!strcmp(key, "wide_emoji")) { + config->wide_emoji = runes_config_parse_bool(val); + } else if (!strcmp(key, "bgcolor")) { cairo_pattern_t *newcolor; newcolor = runes_config_parse_color(val); diff --git a/src/config.h b/src/config.h index 7324a10..7d38611 100644 --- a/src/config.h +++ b/src/config.h @@ -27,6 +27,7 @@ struct runes_config { unsigned int bold_is_bright: 1; unsigned int bold_is_bold: 1; unsigned int audible_bell: 1; + unsigned int wide_emoji: 1; }; RunesConfig *runes_config_new(int argc, char *argv[]); @@ -24,6 +24,8 @@ RunesTerm *runes_term_new( t->scr = vt100_screen_new(t->config->default_rows, t->config->default_cols); vt100_screen_set_scrollback_length(t->scr, t->config->scrollback_length); + vt100_screen_set_wide_emoji(t->scr, t->config->scrollback_length); + runes_window_create_window(t, argc, argv); runes_pty_spawn_subprocess(t, envp, cwd); runes_display_set_context(t, t->w->backend_cr); diff --git a/src/window-xlib.c b/src/window-xlib.c index c12602f..fde8f43 100644 --- a/src/window-xlib.c +++ b/src/window-xlib.c @@ -1213,7 +1213,7 @@ static int runes_window_is_word_char(RunesTerm *t, int row, int col) } uc = g_utf8_get_char(c->contents); - if (vt100_char_width(uc) == 0) { + if (vt100_char_width(uc, t->config->wide_emoji) == 0) { return 0; } if (g_unichar_isspace(uc)) { |