diff --git a/s/CnPCaret b/s/CnPCaret index dcd8340db6edceacb68276d14da9efafccfe1f60..a2994b9cbb3dd5ce5738943f61d58ad6f6ddf3d0 100644 --- a/s/CnPCaret +++ b/s/CnPCaret @@ -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