editor: display now tries to keep more context on screen

FossilOrigin-Name: d9250fbf1914d144e7840d7bbdeb78692101f2ff08c6e49a6fc571e6dcbce161
This commit is contained in:
crc 2017-11-13 19:43:04 +00:00
parent a445f95e36
commit 4b6ee00672

View file

@ -63,7 +63,7 @@ advance to the currently selected line.
#0 @SourceFile [ drop n:inc ] file:for-each-line dup !LineCount ;
:skip-to
@CurrentLine #0 n:max [ @FID file:read-line drop ] times ;
@CurrentLine MAX-LINES #2 / - #0 n:max [ @FID file:read-line drop ] times ;
~~~
Now for words to format the output. This should all be pretty clear in
@ -124,7 +124,7 @@ The indicator is an asterisk, and visually marks the current line.
:display (-)
@SourceFile file:R file:open !FID
clear-display header ---- skip-to
@CurrentLine count-lines MAX-LINES n:min [ display-line ] times drop
@CurrentLine MAX-LINES #2 / - #0 n:max count-lines MAX-LINES n:min [ display-line ] times drop
---- dump-stack
@FID file:close ;
~~~