editbox: move cursor to the end of the inserted string by Prohor Nikiforov and me

git-svn-id: svn://kolibrios.org@7903 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-05-09 17:27:59 +00:00
parent dd347862d8
commit 6db54831c3

View File

@ -548,6 +548,7 @@ edit_box_key.ctrl_v:
.selected_done: .selected_done:
mov ecx,[eax] mov ecx,[eax]
sub ecx,3*4 sub ecx,3*4
push ecx
; in ecx size of string to insert ; in ecx size of string to insert
add ecx,ed_size add ecx,ed_size
mov edx,ed_max mov edx,ed_max
@ -582,6 +583,14 @@ edit_box_key.ctrl_v:
; dec ecx ; dec ecx
; jnz @b ; jnz @b
pop edi eax pop edi eax
;move cursor to the end of the inserted string
pop ecx
add ecx,ed_pos
cmp ecx,ed_max
jbe @f
mov ecx,ed_max
@@:
mov ed_pos, ecx
.no_valid_text: .no_valid_text:
; remove unnecessary memory area ; remove unnecessary memory area
mov ecx,eax mov ecx,eax