From 0987ca8b5b1a6ff50bfc8c3b171fdaf6cfff3a2b Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 10 Nov 2014 23:38:16 +0100 Subject: 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. --- lib/fnkeys.tes | 81 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 18 deletions(-) (limited to 'lib/fnkeys.tes') 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 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 pages of lines down ! -@#p{ - U.c (ESLINESONSCREEN)*Q.cL +! Make DELETE an alternative to ESCAPE ! +@[DC]{} + +@[HOME]{ + .ESLINEFROMPOSITIONESPOSITIONFROMLINEU.p + Q.pU.l + Q.p-.M#c } +@[HOME]{(M[HOME]} -! Function key macros ! -@[DC]{} -@[HOME]{(-(.-(0L.))M#c} -@[END]{(-(.-(:L"S.-1|Z'))M#c} -@[NPAGE]{(-(.-(1M#p.))M#c} -@[PPAGE]{(-(.-(-M#p.))M#c} -@[LEFT]{(-M#c} -@[SLEFT]{(-(.--W.)M#c} -@[RIGHT]{(1M#c} -@[SRIGHT]{(-(.-W.)M#c} -@[UP]{(-(.-B.)M#c} -@[DOWN]{(-(.-L.)M#c} +@[END]{ + .ESLINEFROMPOSITIONESGETLINEENDPOSITION-.M#c +} +@[END]{(M[END]} + +@[NPAGE]{ + .ESLINEFROMPOSITION+(ESLINESONSCREEN) + ESPOSITIONFROMLINEU.p + Q.p"< Z | Q.p '-.M#c +} +@[NPAGE]{(M[NPAGE]} + +@[PPAGE]{ + .ESLINEFROMPOSITION-(ESLINESONSCREEN)U.l + Q.l"< 0 | Q.lESPOSITIONFROMLINE '-.M#c +} +@[PPAGE]{(M[PPAGE]} + +@[LEFT]{ + ."=0|-1'M#c +} +@[LEFT]{(M[LEFT]} + +@[SLEFT]{ + 0,0,.ESWORDSTARTPOSITIONESWORDSTARTPOSITION-.M#c +} +@[SLEFT]{(M[SLEFT]} + +@[RIGHT]{ + .-Z"=0|1'M#c +} +@[RIGHT]{(M[RIGHT]} + +@[SRIGHT]{ + 0,0,.ESWORDENDPOSITIONESWORDENDPOSITION-.M#c +} +@[SRIGHT]{(M[SRIGHT]} + +@[UP]{ + .ESGETCOLUMN + (.ESLINEFROMPOSITION-1) + ESFINDCOLUMN-.M#c +} +@[UP]{(M[UP]} + +@[DOWN]{ + .ESGETCOLUMN + (.ESLINEFROMPOSITION+1) + ESFINDCOLUMN-.M#c +} +@[DOWN]{(M[DOWN]} -- cgit v1.2.3