aboutsummaryrefslogtreecommitdiff
path: root/vterm-module.c
diff options
context:
space:
mode:
authorjixiufeng <jixiufeng@luojilab.com>2019-05-17 23:13:16 +0800
committerjixiufeng <jixiufeng@luojilab.com>2019-05-17 23:13:16 +0800
commit74b8e5cb2d1c6798c42e56ae444e5e96c629f2c5 (patch)
tree24d8052512bf238ddc35156e879815f9d5431376 /vterm-module.c
parentdb9679d77dda82299f7c3aab79a3f5b0967ddce3 (diff)
trying support blink-cursor-mode
Diffstat (limited to 'vterm-module.c')
-rw-r--r--vterm-module.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/vterm-module.c b/vterm-module.c
index f4ee2b5..61de618 100644
--- a/vterm-module.c
+++ b/vterm-module.c
@@ -345,7 +345,11 @@ static int term_movecursor(VTermPos new, VTermPos old, int visible,
static void term_redraw(Term *term, emacs_env *env) {
if (term->is_invalidated) {
- toggle_cursor_blinking(env, term->cursor.blinking);
+ if (term->cursor.blinking_changed) {
+ toggle_cursor_blinking(env, term->cursor.blinking);
+ term->cursor.blinking_changed = false;
+ }
+
toggle_cursor(env, term->cursor.visible);
long bufline_before = env->extract_integer(env, buffer_line_number(env));
refresh_scrollback(term, env);
@@ -412,6 +416,7 @@ static int term_settermprop(VTermProp prop, VTermValue *val, void *user_data) {
break;
case VTERM_PROP_CURSORBLINK:
term->cursor.blinking = val->boolean;
+ term->cursor.blinking_changed = true;
break;
case VTERM_PROP_ALTSCREEN:
invalidate_terminal(term, 0, term->height);
@@ -607,7 +612,7 @@ static emacs_value Fvterm_new(emacs_env *env, ptrdiff_t nargs,
term->height = rows;
term->cursor.visible = true;
- term->cursor.blinking = false;
+ term->cursor.blinking = env->is_not_nil(env, Fblink_cursor_mode);
term->title = NULL;
term->is_title_changed = false;