|
|
@ -213,11 +213,38 @@ svim: |
|
|
|
mov bx, [.buffer_counter_svim] |
|
|
|
cmp bx, 0 |
|
|
|
je .svim_loop |
|
|
|
;print_format .debug_buffer_counter, bx |
|
|
|
|
|
|
|
mov cx, bx |
|
|
|
sub cx, 1 |
|
|
|
sub cx , 1 |
|
|
|
mov bx, [.buffer_for_svim_base] |
|
|
|
add bx, cx |
|
|
|
|
|
|
|
.delete_linebreak: |
|
|
|
cmp BYTE [bx], 10 |
|
|
|
jne .delete_char |
|
|
|
mov BYTE [bx], 0 |
|
|
|
; cx is already the counter |
|
|
|
sub cx, 1 ; Substract one charecter from the buffer, CR and LF |
|
|
|
sub bx, 1 |
|
|
|
mov BYTE [bx], 0 |
|
|
|
mov [.buffer_counter_svim], cx |
|
|
|
|
|
|
|
; Redraw the whole text, |
|
|
|
; move cursor to the top, where the text has to start (line 2) |
|
|
|
xor ax, ax |
|
|
|
xor bx, bx |
|
|
|
mov ah, 0x02 |
|
|
|
mov bh, 0x00 ; page number 0 |
|
|
|
mov dh, 0x02 ; row |
|
|
|
mov dl, 0x00 ; coloumn |
|
|
|
int 0x10 |
|
|
|
|
|
|
|
mov si, [.buffer_for_svim_base] |
|
|
|
call print |
|
|
|
|
|
|
|
jmp .svim_loop |
|
|
|
|
|
|
|
.delete_char: |
|
|
|
mov BYTE [bx], 0 |
|
|
|
mov [.buffer_counter_svim], cx |
|
|
|
;print_format .debug_buffer_counter, cx |
|
|
@ -244,7 +271,7 @@ svim: |
|
|
|
|
|
|
|
.debug_buffer_counter db 'Buffer count: %d', 13, 10, 0 |
|
|
|
.welcome_svim db 'Vim like text editor for SingOS, ESC to exit', 0 |
|
|
|
.welcome_svim_select_file db 'svim v0.0.5 - Open file: ', 0 |
|
|
|
.welcome_svim_select_file db 'svim v0.0.10 - Open file: ', 0 |
|
|
|
.welcome_svim_enter_fileindex db 'Enter fileindex: ', 0 |
|
|
|
.seperate_line db '________________________________________________________________________________', 0 |
|
|
|
.fileindex_for_open_file dw 0 |
|
|
|