SmallSense__SmalltalkEditSupport.st
changeset 445 783f2a4af9c2
parent 444 a47f43af21d6
child 446 59afe5adfbf7
--- a/SmallSense__SmalltalkEditSupport.st	Wed Mar 04 09:51:20 2015 +0000
+++ b/SmallSense__SmalltalkEditSupport.st	Wed Mar 04 06:01:34 2015 +0000
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
 stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
 Copyright (C) 2013-2015 Jan Vrany
@@ -298,6 +300,7 @@
         backspaceIsUndo ifTrue:[
              textView undo.
              backspaceIsUndo := false.
+             electricInsertSuppressed := true.
              ^ true.
         ].
     ].
@@ -307,6 +310,12 @@
         ^ self keyPressPaste.
     ].
 
+    electricInsertSuppressed ifTrue:[ 
+        (key isCharacter and:[ key isSeparator ]) ifTrue:[ 
+            electricInsertSuppressed := false.
+        ].
+    ].
+
 
     key == $^ ifTrue:[
         ^ self keyPressReturnToken
@@ -334,18 +343,21 @@
     ^ false.
 
     "Created: / 07-03-2010 / 09:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 18-05-2014 / 12:45:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-03-2015 / 17:05:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPressDoubleColon
+    electricInsertSuppressed ifTrue:[ ^ false ].
     ^ self electricInsertSnippetAfterDoubleColon
 
     "Created: / 22-10-2013 / 03:08:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-03-2015 / 17:07:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPressEqual
     | line |
 
+    electricInsertSuppressed ifTrue:[ ^ false ].      
     line := textView listAt:textView cursorLine.
     line isNil ifTrue:[ ^ false ].
     line := line string.
@@ -358,6 +370,7 @@
     ^ false
 
     "Created: / 22-10-2013 / 11:01:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-03-2015 / 17:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPressOpenBracket
@@ -366,6 +379,7 @@
 
     | line |
 
+    electricInsertSuppressed ifTrue:[ ^ false ].      
     line := textView listAt: textView cursorLine.
     line notNil ifTrue:[
         line := line string.
@@ -392,7 +406,7 @@
     ^ true.
 
     "Created: / 22-01-2014 / 21:35:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 29-01-2014 / 10:30:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-03-2015 / 17:07:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPressPaste
@@ -400,6 +414,7 @@
 
     UserPreferences current smallSenseSmalltalkIndentOnPasteEnabled ifFalse:[ ^ false ].
 
+    electricInsertSuppressed ifTrue:[ ^ false ].      
     textView checkModificationsAllowed ifTrue:[
         textSelected := textPasted := textView getTextSelectionOrTextSelectionFromHistory.
         currentLineNo := textView currentLine.
@@ -423,12 +438,13 @@
     ^ true
 
     "Created: / 03-05-2014 / 01:08:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 19-07-2014 / 00:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-03-2015 / 17:07:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPressReturn
     | line tokens c i t currentLineIndent closingBracketIndex |
 
+    electricInsertSuppressed ifTrue:[ ^ false ].      
     line := textView listAt: textView cursorLine.
     line isNil ifTrue:[ ^ false ].
     line := line string.
@@ -530,10 +546,11 @@
     ^ false.
 
     "Created: / 25-07-2013 / 00:02:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 23-06-2014 / 20:22:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-03-2015 / 17:07:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPressReturnToken
+    electricInsertSuppressed ifTrue:[ ^ false ].      
     RBFormatter spaceAfterReturnToken ifTrue:[
         self electricDo:[
             textView insertStringAtCursor:'^ '
@@ -543,7 +560,7 @@
     ^ false
 
     "Created: / 24-07-2013 / 23:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 22-01-2014 / 21:10:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-03-2015 / 17:07:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkEditSupport methodsFor:'initialization'!