--- a/Workspace.st Mon Sep 02 19:56:56 2013 +0200
+++ b/Workspace.st Mon Sep 02 19:57:36 2013 +0200
@@ -2363,7 +2363,7 @@
!
suggestionsArrived:suggestions actions:actions
- |v list suggestionOffset keyAndSniplet|
+ |v list suggestionOffset keyAndSniplet lastEntryIsSniplet|
(editView sensor hasKeyPressEventFor:nil) ifTrue:[
self closeCompletionView.
@@ -2375,6 +2375,7 @@
"/ append snipplets, if any (can be easily reached via CRSR-up)
suggestionOffset := 0.
+ lastEntryIsSniplet := false.
(keyAndSniplet := editView findAbbreviationKeyBeforeCursor) notNil ifTrue:[
|abbrev sniplet i line|
@@ -2393,6 +2394,7 @@
list := list copyWith: ( '%1 %2'
bindWith:(sniplet asStringCollection first "contractTo:25")
with: ( ('("',abbrev,'" sniplet)') colorizeAllWith:Color grey)).
+ lastEntryIsSniplet := true.
"/ change below, when reversing the order in above code
"/ suggestionOffset := 2.
@@ -2429,8 +2431,7 @@
self closeCompletionView.
indexInSuggestions := selectedListIndex - suggestionOffset.
- (keyAndSniplet notNil
- and:[ selectedListIndex == list size]) ifTrue:[
+ (lastEntryIsSniplet and:[ selectedListIndex == list size]) ifTrue:[
"/ replace the sniplet
editView sensor
pushUserEvent:#value
@@ -2478,10 +2479,10 @@
!Workspace class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.284 2013-09-02 09:01:14 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.285 2013-09-02 17:57:36 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.284 2013-09-02 09:01:14 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.285 2013-09-02 17:57:36 cg Exp $'
! !