mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 21:48:06 +11:00
ed: fix broken buf insert logic
This commit is contained in:
parent
1a5a1b9861
commit
8d7abd9994
@ -147,9 +147,12 @@ bufInsertLine:
|
|||||||
; when it's time to insert the line in the space we make.
|
; when it's time to insert the line in the space we make.
|
||||||
ld hl, (BUF_LINECNT)
|
ld hl, (BUF_LINECNT)
|
||||||
call bufLineAddr
|
call bufLineAddr
|
||||||
|
; HL is pointing to *first byte* after last line. Our source needs to
|
||||||
|
; be the second byte of the last line and our dest is the second byte
|
||||||
|
; after the last line.
|
||||||
push hl \ pop de
|
push hl \ pop de
|
||||||
dec hl
|
dec hl ; second byte of last line
|
||||||
dec hl
|
inc de ; second byte beyond last line
|
||||||
; HL = BUF_LINECNT-1, DE = BUF_LINECNT, BC is set. We're good!
|
; HL = BUF_LINECNT-1, DE = BUF_LINECNT, BC is set. We're good!
|
||||||
lddr
|
lddr
|
||||||
; We still need to increase BUF_LINECNT
|
; We still need to increase BUF_LINECNT
|
||||||
|
Loading…
Reference in New Issue
Block a user