From 6db54831c303ad2dfbf1b09dc2fcf656abd4f529 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sat, 9 May 2020 17:27:59 +0000 Subject: [PATCH] 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 --- programs/develop/libraries/box_lib/trunk/editbox.asm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/programs/develop/libraries/box_lib/trunk/editbox.asm b/programs/develop/libraries/box_lib/trunk/editbox.asm index 8f0432a4e5..6d5198fdae 100644 --- a/programs/develop/libraries/box_lib/trunk/editbox.asm +++ b/programs/develop/libraries/box_lib/trunk/editbox.asm @@ -548,6 +548,7 @@ edit_box_key.ctrl_v: .selected_done: mov ecx,[eax] sub ecx,3*4 + push ecx ; in ecx size of string to insert add ecx,ed_size mov edx,ed_max @@ -581,7 +582,15 @@ edit_box_key.ctrl_v: ; stosb ; dec ecx ; 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: ; remove unnecessary memory area mov ecx,eax