Commit 020e9c0d authored by Andy Vawer's avatar Andy Vawer Committed by ROOL
Browse files

When clicking in window to move caret to another icon, remove any selection...

When clicking in window to move caret to another icon, remove any selection from other icons in the window to prevent unwanted user deletion of text in the selected icon.
parent 0e7a0844
......@@ -558,7 +558,25 @@ wscp_remove_current_caret ROUT
TST R4,#crf_selection :OR: crf_ghostcaret
BNE %FT01
00 ; we are dealing with the main caret, so do the check
00 ; we are dealing with the main caret, so do the checks
; is there a current selection in this window?
CMP R0,#-1 ; no current window
LDRNE R14,[R10,#w_seldata+wselicon]
CMPNE R14,#-1 ; any current selection?
CMPNE R14,R1 ; in the same icon as the new one?
BEQ %FT50
; remove current selection and redraw its icon
Push "R0-R2,R10,R11"
MOV R0,R14
MOV R14,#-1
STR R14,[R10,#w_seldata+wselicon]
MOV R1,#0
MOV R2,#0
BL int_set_icon_state
Pull "R0-R2,R10,R11"
50
LDR R14,caretdata
CMP R0,R14
BEQ %FT01
......@@ -660,7 +678,7 @@ wscp_rcc_selection_redraw
STR R14,redrawcareticon
Pull "R1-R5,R10,R11,PC"
wscp_rcc_queue_redraw
wscp_rcc_queue_redraw ROUT
; r11=pointer to window handle (ie caret data block or similar)
; r14=icon handle from the current caret state
LDR R11,[R11] ; get the window handle itself
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment