[TF] Scrollback.
Brought to you by:
kenkeys
|
From: eleet at ele-et.de (P. Hartmann) - 2003-03-29 17:16:56
|
Hi there,
On Sat, 2003-03-29 at 15:37, ep...@in... wrote:
> I was thinking about using "/recall" to simulate it, but I have this theory that
> someone might have done that already. If anyone has done that/has found that,
> can email it to me?
The attached file contains the required tf-code to use the PAGEUP,
PAGEDOWN-keys for history scrollback.
Maybe you have to or want to change the keybindings (the -b'...' part in
the definitions).
hth,
Philipp
--
Philipp Hartmann <el...@el...>
-------------- next part --------------
/def -b'^[[5~' historyBack=\
/let _lines $[lines()-(visual =~ 'on' ? isize+4 : 4)]%;\
/if (!historyLastLine | (time()-historyTime > 120)) \
/test regmatch('([0-9]+): ', $$(/recall -g -ag #1))%;\
/set historyLastLine %P1%;\
/let historyShow 1%;\
/else \
/if (historyLastLine <= _lines) \
/beep 1%;\
/else \
/set historyLastLine $[historyFirstLine-1]%;\
/let historyShow 1%;\
/endif%;\
/endif%;\
/set historyFirstLine $[historyLastLine > _lines ? historyLastLine-_lines : 1]%;\
/set historyTime $[time()]%;\
/if (historyShow) \
/recall -ag -g %{historyFirstLine}-%{historyLastLine}%;\
/endif
/def -b'^[[6~' historyForward=\
/let _lines $[lines()-(visual =~ 'on' ? isize+4 : 4)]%;\
/test regmatch('([0-9]+): ', $$(/recall -g -ag #1))%;\
/let historyBottomLine %P1%;\
/if (!historyLastLine | (time()-historyTime > 120)) \
/set historyLastLine %historyBottomLine%;\
/beep 1%;\
/else \
/if (historyLastLine == historyBottomLine) \
/beep 1%;\
/set historyLastLine %historyBottomLine%;\
/else \
/set historyLastLine $[historyLastLine+_lines < historyBottomLine ?
\
historyLastLine+_lines+1 : historyBottomLine]%;\
/let historyShow 1%;\
/endif%;\
/endif%;\
/set historyTime $[time()]%;\
/set historyFirstLine $[historyLastLine > _lines ? historyLastLine-_lines : 1]%;\
/if (historyShow) \
/recall -ag -g %{historyFirstLine}-%{historyLastLine}%;\
/endif
|