aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-curses
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface-curses')
-rw-r--r--src/interface-curses/interface.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c
index 94501cb..d07ff21 100644
--- a/src/interface-curses/interface.c
+++ b/src/interface-curses/interface.c
@@ -993,10 +993,11 @@ teco_interface_getch(gboolean widechar)
/*
* Signal that we accept input by drawing a real cursor in the message bar.
+ * FIXME: curs_set(2) would be better, but isn't always visible.
*/
wmove(teco_interface.msg_window, 0, 0);
- curs_set(1);
wrefresh(teco_interface.msg_window);
+ curs_set(1);
gchar buf[4];
gint i = 0;
@@ -1023,7 +1024,6 @@ teco_interface_getch(gboolean widechar)
i = 0;
} while (cp < 0);
- curs_set(0);
return cp;
}
@@ -1837,16 +1837,6 @@ teco_interface_refresh(gboolean force)
clearok(curscr, TRUE);
/*
- * Let Scinterm enable/disable the hardware cursor
- * based on the CARETSTYLE_CURSES.
- * Doing this repeatedly ensures you can change the
- * caret style interactively.
- * Also, window resizes enable the cursor on PDCurses/wincon
- * sometimes (FIXME).
- */
- curs_set(0);
-
- /*
* Info window is updated very often which is very
* costly, especially when using PDC_set_title(),
* so we redraw it here, where the overhead does
@@ -1870,6 +1860,19 @@ teco_interface_refresh(gboolean force)
*/
teco_view_update_cursor(teco_cmdline.view);
doupdate();
+
+ /*
+ * Scinterm enables/disables the hardware cursor,
+ * but only if CARETSTYLE_CURSES is used.
+ * Disabling the cursor repeatedly ensures you can change
+ * the caret style interactively.
+ * It also makes sure the cursor is reset after
+ * teco_interface_getch().
+ * Also, window resizes sometimes enable the hardware cursor on
+ * PDCurses/wincon (FIXME).
+ */
+ if (!(teco_view_ssm(teco_cmdline.view, SCI_GETCARETSTYLE, 0, 0) & CARETSTYLE_CURSES))
+ curs_set(0);
}
#if NCURSES_MOUSE_VERSION >= 2