Workspace.st
changeset 4745 ba8ca65cd308
parent 4744 2b4137ad41eb
child 4750 0b55ac6feb54
--- a/Workspace.st	Thu Sep 05 15:04:23 2013 +0200
+++ b/Workspace.st	Thu Sep 05 15:37:10 2013 +0200
@@ -138,7 +138,7 @@
 !
 
 initializeDefaultAbbreviations
-    "default sniplets/abbreviations. TODO: save/load sniplets"
+    "default snippets/abbreviations. TODO: save/load sniplets"
 
     "flush and reinitialize sniplets with:
          Sniplets := Dictionary new.
@@ -2103,10 +2103,10 @@
      cursor, find an abbrev for it, return the key and the abbreviation for it.   
      If none is found, return nil"
 
-    |sniplets keys minMax maxKeyLen minKeyLen stringBeforeCursor|
-
-    sniplets := self class sniplets.
-    keys := sniplets keys.
+    |snippets keys minMax maxKeyLen minKeyLen stringBeforeCursor|
+
+    snippets := self class sniplets.
+    keys := snippets keys.
 
     minMax := (keys collect:[:k | k size]) minMax.
     minKeyLen := minMax first.
@@ -2119,7 +2119,7 @@
         |lCharactersBeforeCursor expandedString|
 
         lCharactersBeforeCursor := stringBeforeCursor last:keyLen.
-        expandedString := sniplets at:lCharactersBeforeCursor ifAbsent:nil.
+        expandedString := snippets at:lCharactersBeforeCursor ifAbsent:nil.
         expandedString notNil ifTrue:[
             ^ { lCharactersBeforeCursor . expandedString withCRs }
         ].
@@ -2134,13 +2134,13 @@
      cursor, find an abbrev for it, select it and return the abbreviation for it.   
      If none is found, do not select and return nil"
 
-    |keyAndSniplet sniplet key|
-
-    (keyAndSniplet := self findAbbreviationKeyBeforeCursor) notNil ifTrue:[
-        key := keyAndSniplet first.
-        sniplet := keyAndSniplet second.
+    |keyAndSnippet snippet key|
+
+    (keyAndSnippet := self findAbbreviationKeyBeforeCursor) notNil ifTrue:[
+        key := keyAndSnippet first.
+        snippet := keyAndSnippet second.
         self selectFromLine:cursorLine col:cursorCol-key size toLine:cursorLine col:cursorCol-1.
-        ^ sniplet
+        ^ snippet
     ].
     ^ nil.
 
@@ -2399,7 +2399,7 @@
 suggestionsArrived:suggestions actions:actions autoSelect:autoSelectArg
     "the background process has generated some suggestions"
 
-    |v list suggestionOffset keyAndSniplet indexOfSniplet|
+    |v list suggestionOffset keyAndSnippet indexOfSnippet|
 
     (editView sensor hasKeyPressEventFor:nil) ifTrue:[ 
         self closeCompletionView. 
@@ -2411,12 +2411,12 @@
 
     "/ append snipplet, if any (can be easily reached via CRSR-up)
     suggestionOffset := 0.
-    indexOfSniplet := nil.
-    (keyAndSniplet := editView findAbbreviationKeyBeforeCursor) notNil ifTrue:[
+    indexOfSnippet := nil.
+    (keyAndSnippet := editView findAbbreviationKeyBeforeCursor) notNil ifTrue:[
         |abbrev sniplet i line|
 
-        abbrev := keyAndSniplet first.
-        sniplet := keyAndSniplet second.
+        abbrev := keyAndSnippet first.
+        sniplet := keyAndSnippet second.
 
         "/ if the abbreviation is simply at the end of a longer word, ignore the abbrev.
         line := editView lineStringBeforeCursor.
@@ -2429,8 +2429,8 @@
                 list isEmpty ifFalse:[ list := list copyWith: '-' ]. 
                 list := list copyWith: ( '%1 %2'
                                         bindWith:(sniplet asStringCollection first "contractTo:25")
-                                        with: ( ('("',abbrev,'" sniplet)') colorizeAllWith:Color grey)).
-                indexOfSniplet := list size.
+                                        with: ( ('("',abbrev,'" snippet)') colorizeAllWith:Color grey)).
+                indexOfSnippet := list size.
 
                 "/ change below, when reversing the order in above code
                 "/ suggestionOffset := 2.
@@ -2481,7 +2481,7 @@
 
                         self closeCompletionView.
                         indexInSuggestions := selectedListIndex - suggestionOffset.
-                        (selectedListIndex == indexOfSniplet) ifTrue:[
+                        (selectedListIndex == indexOfSnippet) ifTrue:[
                             "/ replace the sniplet
                             editView sensor
                                 pushUserEvent:#value
@@ -2533,10 +2533,10 @@
 !Workspace class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.296 2013-09-05 13:04:23 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.297 2013-09-05 13:37:10 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.296 2013-09-05 13:04:23 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.297 2013-09-05 13:37:10 cg Exp $'
 ! !