diff src/term.c @ 36:125e80798a85 v7.0021

updated for version 7.0021
author vimboss
date Thu, 09 Dec 2004 21:34:53 +0000
parents cc049b00ee70
children 410fa1a31baf
line wrap: on
line diff
--- a/src/term.c
+++ b/src/term.c
@@ -1643,6 +1643,7 @@ set_termname(term)
 				{KS_CIS, "IS"}, {KS_CIE, "IE"},
 				{KS_TS, "ts"}, {KS_FS, "fs"},
 				{KS_CWP, "WP"}, {KS_CWS, "WS"},
+				{KS_CSI, "SI"}, {KS_CEI, "EI"},
 				{(enum SpecialKey)0, NULL}
 			    };
 
@@ -3400,6 +3401,31 @@ cursor_off()
 }
 
 /*
+ * Set cursor shape to match Insert mode.
+ */
+    void
+term_cursor_shape()
+{
+    static int showing_insert_mode = MAYBE;
+
+    if (!full_screen || *T_CSI == NUL || *T_CEI == NUL)
+	return;
+
+    if (State & INSERT)
+    {
+	if (showing_insert_mode != TRUE)
+	    out_str(T_CSI);	    /* disable cursor */
+	showing_insert_mode = TRUE;
+    }
+    else
+    {
+	if (showing_insert_mode != FALSE)
+	    out_str(T_CEI);	    /* disable cursor */
+	showing_insert_mode = FALSE;
+    }
+}
+
+/*
  * Set scrolling region for window 'wp'.
  * The region starts 'off' lines from the start of the window.
  * Also set the vertical scroll region for a vertically split window.  Always