aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--fallback.teco_inibin2118 -> 2148 bytes
-rw-r--r--lib/color.tes7
-rw-r--r--lib/fnkeys.tes23
-rw-r--r--src/interface-curses/interface.c3
-rw-r--r--src/interface-gtk/interface.c3
5 files changed, 36 insertions, 0 deletions
diff --git a/fallback.teco_ini b/fallback.teco_ini
index edd8b7f..954b070 100644
--- a/fallback.teco_ini
+++ b/fallback.teco_ini
Binary files differ
diff --git a/lib/color.tes b/lib/color.tes
index f732848..dcf2065 100644
--- a/lib/color.tes
+++ b/lib/color.tes
@@ -79,4 +79,11 @@
!* Set up brace lightning *!
:M[color.bracelight],34M[color.set]
:M[color.error],35M[color.set]
+
+ !* Configure fold margin *!
+ :M[color.linenumber]U.fU.b
+ Q.b,1ESSETFOLDMARGINCOLOUR Q.b,1ESSETFOLDMARGINHICOLOUR
+ 10000++,30ESMARKERDEFINE Q.f,30ESMARKERSETFORE Q.b,30ESMARKERSETBACK
+ 10000+-,31ESMARKERDEFINE Q.f,31ESMARKERSETFORE Q.b,31ESMARKERSETBACK
+ (2^*30 # 2^*31),2ESSETMARGINMASKN 0,2ESSETMARGINTYPEN
}
diff --git a/lib/fnkeys.tes b/lib/fnkeys.tes
index 3fd0701..3445342 100644
--- a/lib/fnkeys.tes
+++ b/lib/fnkeys.tes
@@ -117,6 +117,12 @@
1U[ CLOSE]
!*
+ * F1 toggles __all__ folds.
+ *!
+@[ F1]{(2ESFOLDALL{-14D}}
+1U[ F1]
+
+!*
* Zoom with F9/F10 if function keys are enabled.
* This is automatically rubbed out.
*!
@@ -136,9 +142,26 @@
* Ctrl+right click: Insertion beginning of line
* Scroll wheel: scrolls (faster with shift)
* Ctrl+scroll wheel: zoom (GTK-only)
+ *
+ * Also, you can click on the folding margin to toggle folds.
*!
@[MOUSE]{
-2EJESCHARPOSITIONFROMPOINTU.p
+
+ -2EJU.x ESGETMARGINLEFTU.r
+ ESGETMARGINS<
+ Q.rU.l Q.iESGETMARGINWIDTHN%.r
+ Q.x-Q.l+1"> Q.x-Q.r"< !* mouse within margin i *!
+ Q.iESGETMARGINMASKN&(-33554432)"N !* folding margin *!
+ -EJ-2"= !* mouse released *!
+ Q.pESLINEFROMPOSITIONESTOGGLEFOLD
+ {-9D}
+ '
+ '
+ 1; !* handle like click in text area *!
+ ' '
+ %.i>
+
-4EJ&2"N Q.pESLINEFROMPOSITIONESPOSITIONFROMLINEU.p '
1,Q.pESWORDSTARTPOSITION:U.#ws
1,Q.pESWORDENDPOSITION:U.#we
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c
index a71ca20..e3013fb 100644
--- a/src/interface-curses/interface.c
+++ b/src/interface-curses/interface.c
@@ -2134,6 +2134,9 @@ teco_interface_event_loop_iter(void)
*/
if (teco_interface_current_view == last_view)
teco_interface_ssm(SCI_SETFIRSTVISIBLELINE, last_vpos, 0);
+ /* also unfold automatically */
+ sptr_t dot = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0);
+ teco_interface_ssm(SCI_ENSUREVISIBLE, teco_interface_ssm(SCI_LINEFROMPOSITION, dot, 0), 0);
teco_interface_ssm(SCI_SCROLLCARET, 0, 0);
teco_interface_refresh();
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c
index 045f9d7..06abe61 100644
--- a/src/interface-gtk/interface.c
+++ b/src/interface-gtk/interface.c
@@ -1429,6 +1429,9 @@ teco_interface_input_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
if (event->type == GDK_KEY_PRESS) {
if (teco_interface_current_view == last_view)
teco_interface_ssm(SCI_SETFIRSTVISIBLELINE, last_vpos, 0);
+ /* also unfold automatically */
+ sptr_t dot = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0);
+ teco_interface_ssm(SCI_ENSUREVISIBLE, teco_interface_ssm(SCI_LINEFROMPOSITION, dot, 0), 0);
teco_interface_ssm(SCI_SCROLLCARET, 0, 0);
}