diff options
Diffstat (limited to 'vterm-module.c')
| -rw-r--r-- | vterm-module.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/vterm-module.c b/vterm-module.c index 45b97b3..7d44293 100644 --- a/vterm-module.c +++ b/vterm-module.c @@ -491,16 +491,15 @@ static emacs_value render_text(emacs_env *env, Term *term, char *buffer, static emacs_value color_to_rgb_string(emacs_env *env, Term *term, VTermColor *color) { - emacs_value palette = symbol_value(env, Qansi_color_names_vector); if (VTERM_COLOR_IS_DEFAULT_FG(color)) { - return env->vec_get(env, palette, 7); + return vterm_get_color(env, -1); } if (VTERM_COLOR_IS_DEFAULT_BG(color)) { - return env->vec_get(env, palette, 0); + return vterm_get_color(env, -2); } if (VTERM_COLOR_IS_INDEXED(color)) { if (color->indexed.idx < 16) { - return env->vec_get(env, palette, color->indexed.idx % 8); + return vterm_get_color(env, color->indexed.idx); } else { VTermState *state = vterm_obtain_state(term->vt); vterm_state_get_palette_color(state, color->indexed.idx, color); @@ -736,8 +735,6 @@ int emacs_module_init(struct emacs_runtime *ert) { Qbar = env->make_global_ref(env, env->intern(env, "bar")); Qhbar = env->make_global_ref(env, env->intern(env, "hbar")); Qcursor_type = env->make_global_ref(env, env->intern(env, "cursor-type")); - Qansi_color_names_vector = - env->make_global_ref(env, env->intern(env, "ansi-color-names-vector")); // Functions Fsymbol_value = env->make_global_ref(env, env->intern(env, "symbol-value")); @@ -772,6 +769,8 @@ int emacs_module_init(struct emacs_runtime *ert) { Fvterm_invalidate = env->make_global_ref(env, env->intern(env, "vterm--invalidate")); Feq = env->make_global_ref(env, env->intern(env, "eq")); + Fvterm_get_color = + env->make_global_ref(env, env->intern(env, "vterm--get-color")); // Exported functions emacs_value fun; |
