aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-10 23:38:16 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-10 23:38:16 +0100
commit0987ca8b5b1a6ff50bfc8c3b171fdaf6cfff3a2b (patch)
tree0981c1aa87c594c8208fe4dc19b863019a0286d6 /lib
parent2003610332b8ffb1571a6e1ae697c08c3d05d701 (diff)
downloadsciteco-0987ca8b5b1a6ff50bfc8c3b171fdaf6cfff3a2b.tar.gz
revised default function key macros
* use shorter function key macros. * instead, every function key has a commandline editing macro based on the macro "^Tc" * dot is no longer modified to calculate positions, instead Scintilla messages are used * prevent that function key macros move dot off-page * improved behaviour: HOME will will first skip spaces and tabs at the beginning of the line and only the second press will move dot to the real line beginning. UP and DOWN will try to keep the column. However this does not work quite as good as in other editors, since there's no (sane) way to save the column last set by one of the function keys.
Diffstat (limited to 'lib')
-rw-r--r--lib/fnkeys.tes81
1 files changed, 63 insertions, 18 deletions
diff --git a/lib/fnkeys.tes b/lib/fnkeys.tes
index 94c886d..fba0beb 100644
--- a/lib/fnkeys.tes
+++ b/lib/fnkeys.tes
@@ -1,28 +1,73 @@
-! Define some default function key macros !
+! Here we define some reasonable default function key macros.
+ Their corresponding command-line editing macros begin with  !
! edit command line to move <n> chars, updating existing move ops !
-@#c{{U.c
- <-A-("=%.n|-A-)"=-%.n|0''">-D1;'-D>
+@#c{{U.c
+ <-A-("=-D1;' -D>
.">
-A-)"= -S(\U.v .,Z-2D 0A-C"=2DQ.v|2D-Q.v'%.c | I(Q.c '
| I(Q.c '
"> Q.c\IC) | -Q.c\IR) '
}}
-! go <n> pages of lines down !
-@#p{
- U.c (ESLINESONSCREEN)*Q.cL
+! Make DELETE an alternative to ESCAPE !
+@[DC]{}
+
+@[HOME]{
+ .ESLINEFROMPOSITIONESPOSITIONFROMLINEU.p
+ Q.pU.l <Q.l-."U 1; ' Q.l-.AU.c Q.c-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