Procházet zdrojové kódy

VE: ensure absence of ctrl chars before insertion point

Previously, inserting at a position that had null chars before it
would result in a block that wouldn't properly display with LIST.
master
Virgil Dupras před 3 roky
rodič
revize
6f4f870dd4
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. +4
    -1
      blk.fs

+ 4
- 1
blk.fs Zobrazit soubor

@@ -681,9 +681,12 @@ CREATE FBUF 64 ALLOT0
DUP BEGIN C@+ 0x20 < UNTIL -^ 1- ; DUP BEGIN C@+ 0x20 < UNTIL -^ 1- ;
: _rbufsz ( size of linebuf to the right of curpos ) : _rbufsz ( size of linebuf to the right of curpos )
EDPOS @ 64 MOD 63 -^ ; EDPOS @ 64 MOD 63 -^ ;
: _lnfix ( --, ensure no ctl chars in line before EDPOS )
EDPOS @ DUP 0xffc0 AND 2DUP = IF 2DROP EXIT THEN DO
I _cpos DUP C@ 0x20 < IF 0x20 SWAP C! ELSE DROP THEN LOOP ;
: _i ( i without _pln and _type. used in VE ) : _i ( i without _pln and _type. used in VE )
_rbufsz IBUF _blen 2DUP > IF _rbufsz IBUF _blen 2DUP > IF
TUCK - ( ilen chars-to-move )
_lnfix TUCK - ( ilen chars-to-move )
SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen ) SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen )
3 PICK MOVE- ( ctm ilen ) NIP ( ilen ) 3 PICK MOVE- ( ctm ilen ) NIP ( ilen )
ELSE DROP 1+ ( ilen becomes rbuffsize+1 ) THEN ELSE DROP 1+ ( ilen becomes rbuffsize+1 ) THEN


Načítá se…
Zrušit
Uložit