Quellcode durchsuchen

Navigation and editing in place in svim works

jorn_dev
Jørn Guldberg vor 5 Jahren
Ursprung
Commit
aac2b53e5e
2 geänderte Dateien mit 24 neuen und 24 gelöschten Zeilen
  1. +1
    -1
      kernel.nasm
  2. +23
    -23
      lib/svim.nasm

+ 1
- 1
kernel.nasm Datei anzeigen

@ -304,4 +304,4 @@ data:
times ((1<<20)-($-$$) - 26) db 0 ; sector 258 to sector 2048 should be avaliable to the filesystem.
magic_string_end_of_SingOS_kernel db '** END OF KERNEL SingOS **'
times ((1<<24)-($-$$)) db 0
times ((1<<23)-($-$$)) db 0

+ 23
- 23
lib/svim.nasm Datei anzeigen

@ -365,31 +365,31 @@ handle_up_key_pressed:
handle_down_key_pressed:
call get_cursor_position ; Find the position of the cursor
xor cx, cx
mov cl, dl ; Store coulun count
push cx ; save the column count.
inc cx
xor ax, ax
mov al, dl ; Store coulun count
push ax ; save the column count.
call svim_get_right_line_count ; updates the value in svim_get_cursor_distance_to_next_line_break
mov cx, [svim_get_cursor_distance_to_next_line_break]
.find_first_line_break:
cmp BYTE cl, 0
je .end;.find_left_position_on_new_line
cmp cx, 0
je .find_left_position_on_new_line
call handle_right_key_pressed
dec cl
dec cx
jmp .find_first_line_break
; .find_left_position_on_new_line:
; call svim_get_right_line_count ; updates the value in svim_get_cursor_distance_to_next_line_break
; mov ax, [svim_get_cursor_distance_to_next_line_break]
; pop cx
; cmp cx, ax
; jg .move_curser_to_correct_position_on_the_new_line
; mov cx, ax
; .move_curser_to_correct_position_on_the_new_line:
; cmp cx, 0
; je .end
; call handle_right_key_pressed
; dec cx
; jmp .move_curser_to_correct_position_on_the_new_line
.find_left_position_on_new_line:
call svim_get_right_line_count ; updates the value in svim_get_cursor_distance_to_next_line_break
mov ax, [svim_get_cursor_distance_to_next_line_break]
pop cx
cmp cx, ax
jle .move_curser_to_correct_position_on_the_new_line
mov cx, ax
.move_curser_to_correct_position_on_the_new_line:
cmp cx, 0
je .end
call handle_right_key_pressed
dec cx
jmp .move_curser_to_correct_position_on_the_new_line
.end:
ret
@ -439,7 +439,7 @@ svim_get_right_line_count:
inc cx ; add one to the counter
jmp .check_next
.end_line_break:
;inc cx ; add one to the counter
inc cx ; add one to the counter
.end:
mov WORD [svim_get_cursor_distance_to_next_line_break], cx
popa
@ -500,7 +500,7 @@ svim_counter_char_in_left_buffer dw 0
svim_counter_char_in_right_buffer dw 0
seperate_line db '________________________________________________________________________________', 0
welcome_svim db 'Vim like text editor for SingOS, ESC to exit', 0
welcome_svim_select_file db 'svim v0.0.28 - Open file: ', 0
welcome_svim_select_file db 'svim v0.0.32 - Open file: ', 0
welcome_svim_enter_fileindex db 'Enter fileindex: ', 0
fileindex_for_open_file dw 0
svim_total_file_size_counter dw 0

Laden…
Abbrechen
Speichern