`TerminalView`: do not tinker with cursor position when selecting via mouse jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 13 Jun 2017 14:44:00 +0100
branchjv
changeset 5567 db72eb21203c
parent 5566 a6aaadb2f122
child 5568 a44d0289bfbf
`TerminalView`: do not tinker with cursor position when selecting via mouse ...otherwise view's cursor position and client's cursor position get out of a sync.
TerminalView.st
--- a/TerminalView.st	Mon Jun 12 16:28:21 2017 +0100
+++ b/TerminalView.st	Tue Jun 13 14:44:00 2017 +0100
@@ -924,6 +924,20 @@
     "Modified: / 17-07-2014 / 19:40:45 / cg"
 !
 
+extendSelectionToX:x y:y setPrimarySelection:aBoolean
+    | savedCursorLine savedCursorCol |
+
+    "/ We must preserve the cursor position here. Cursor position
+    "/ is controlled by the client after we send it a control 
+    "/ sequence!!
+    savedCursorLine := cursorLine.
+    savedCursorCol  := cursorCol.
+    super extendSelectionToX:x y:y setPrimarySelection:aBoolean.
+    self setCursorLine: savedCursorLine col: savedCursorCol
+
+    "Created: / 13-06-2017 / 14:35:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 keyPress:aKey x:x y:y
     <resource: #keyboard (#Control #Control_L #Control_R
                           #Shift #Shift_L #Shift_R