1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-25 05:08:05 +11:00

VE: Add dirtiness indicator in status bar

Written from VE!
This commit is contained in:
Virgil Dupras 2020-06-11 21:52:08 -04:00
parent 838c88459b
commit dc368597a6
8 changed files with 57 additions and 38 deletions

26
blk/121
View File

@ -1,16 +1,16 @@
All keystrokes are directly interpreted by VE and have the
effect described below.
The status line displays the active block number, then the
"modifier" and then the cursor position. When the block is dir-
ty, an "*" is displayed next. At the right corner, a mode letter
can appear. 'R' for replace, 'I' for insert, 'F' for find.
Pressing a 0-9 digit accumulates that digit into what is named
the "modifier". That modifier affects the behavior of many
keystokes described below. The modifier starts at zero, but
most commands interpret a zero as a 1 so that they can have an
effect.
'g' selects the block specified by the modifier as the current
block. Any change made to the previously selected block is
saved beforehand.
'[' and ']' advances the selected block by "modifier". 't' opens
the previously opened block.
(cont.)
(cont.)

24
blk/122
View File

@ -1,16 +1,16 @@
'h' and 'l' move the cursor by "modifier" characters. 'j' and
'k', by lines.
All keystrokes are directly interpreted by VE and have the
effect described below.
'H' goes to the beginning of the line, 'L' to the end.
Pressing a 0-9 digit accumulates that digit into what is named
the "modifier". That modifier affects the behavior of many
keystokes described below. The modifier starts at zero, but
most commands interpret a zero as a 1 so that they can have an
effect.
'w' moves forward by "modifier" words. 'b' moves backward.
'W' moves to end-of-word. 'B', backwards.
'g' selects the block specified by the modifier as the current
block. Any change made to the previously selected block is
saved beforehand.
'I', 'F', 'Y', 'X' and 'E' invoke the corresponding command
from the Block Editor (B100). Refer to documentation there.
'o' inserts a blank line after the cursor. 'O', before.
'D' deletes "modifier" lines at the cursor. The first of those
lines is copied to IBUF.
'[' and ']' advances the selected block by "modifier". 't' opens
the previously opened block.
(cont.)

20
blk/123
View File

@ -1,16 +1,16 @@
'f' puts the contents of your previous cursor movement into
FBUF. If that movement was a forward movement, it brings the
cursor back where it was. This allows for an efficient combi-
nation of movements and 'E'. For example, if you want to delete
the next word, you type 'w', then 'f', then check your FBUF to
be sure, then press 'E'.
'R' goes into replace mode at current cursor position.
Following keystrokes replace current character and advance
cursor. Press return to return to normal mode.
'h' and 'l' move the cursor by "modifier" characters. 'j' and
'k', by lines.
'H' goes to the beginning of the line, 'L' to the end.
'w' moves forward by "modifier" words. 'b' moves backward.
'W' moves to end-of-word. 'B', backwards.
'I', 'F', 'Y', 'X' and 'E' invoke the corresponding command
'o' inserts a blank line after the cursor. 'O', before.
'D' deletes "modifier" lines at the cursor. The first of those
lines is copied to IBUF.
(cont.)

16
blk/124 Normal file
View File

@ -0,0 +1,16 @@
'f' puts the contents of your previous cursor movement into
FBUF. If that movement was a forward movement, it brings the
cursor back where it was. This allows for an efficient combi-
nation of movements and 'E'. For example, if you want to delete
the next word, you type 'w', then 'f', then check your FBUF to
be sure, then press 'E'.
'R' goes into replace mode at current cursor position.
Following keystrokes replace current character and advance
cursor. Press return to return to normal mode.

View File

@ -7,10 +7,10 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 ,
: clrscr LINES 0 DO i aty COLS nspcs LOOP ;
: gutter ( ln n ) OVER + SWAP DO 67 i AT-XY '|' EMIT LOOP ;
: status 0 aty ." BLK" SPC BLK> ? SPC ACC ?
SPC EDPOS @ 64 /MOD . ',' EMIT . 10 nspcs ;
SPC EDPOS @ 64 /MOD . ',' EMIT . SPC
BLKDTY @ IF '*' EMIT THEN 10 nspcs ;
: contents 3 aty BLK> @ LIST 3 16 gutter ;
: selblk BLK> @ PREVBLK ! BLK@ contents ;
: mode! ( c -- ) 63 0 AT-XY ;

View File

@ -10,7 +10,7 @@
: VE
clrscr 0 ACC ! 0 PREVPOS ! contents
BEGIN status bufs setpos KEY handle UNTIL
19 aty ;
19 aty (infl) ;

View File

@ -13,3 +13,4 @@

View File

@ -12,3 +12,5 @@
PREV CURRENT !
;
: EMPTY LIT< _sys FIND IF DUP HERE ! CURRENT ! THEN ;