EditTextViewCompletionSupport.st
changeset 6594 c347f9e598d7
parent 6433 fa1517a0ad10
child 6627 322e0fc5efc4
equal deleted inserted replaced
6593:6ed15ff79b07 6594:c347f9e598d7
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "{ Package: 'stx:libwidg' }"
     1 "{ Package: 'stx:libwidg' }"
     4 
     2 
     5 "{ NameSpace: Smalltalk }"
     3 "{ NameSpace: Smalltalk }"
     6 
     4 
     7 Object subclass:#EditTextViewCompletionSupport
     5 Object subclass:#EditTextViewCompletionSupport
    86 
    84 
    87     "/ open on CTRL- or TAB-key?
    85     "/ open on CTRL- or TAB-key?
    88     (completionView notNil and:[completionView realized]) ifFalse:[
    86     (completionView notNil and:[completionView realized]) ifFalse:[
    89         editView hasSelection ifFalse:[
    87         editView hasSelection ifFalse:[
    90             ((ch := editView characterBeforeCursor) notNil "/ i.e. not at begin of line
    88             ((ch := editView characterBeforeCursor) notNil "/ i.e. not at begin of line
    91             and:[ ch isLetterOrDigit or:[ ch == $_ ] ]) ifTrue:[
    89             and:[ ch isLetterOrDigitOrUnderline ]) ifTrue:[
    92                 (key == #Control_L or:[ key == #Ctrl or:[ key == #Control_R or:[ key == #Control]]]) ifTrue:[
    90                 (key == #Control_L or:[ key == #Ctrl or:[ key == #Control_R or:[ key == #Control]]]) ifTrue:[
    93                     UserPreferences current codeCompletionOnControlKey ifTrue:[
    91                     UserPreferences current codeCompletionOnControlKey ifTrue:[
    94                         autoSelect := true.
    92                         autoSelect := true.
    95                         self updateCompletionList
    93                         self updateCompletionList
    96                     ]
    94                     ]
   163     ].
   161     ].
   164     ^ false.
   162     ^ false.
   165 
   163 
   166     "Modified: / 24-08-2017 / 21:32:52 / cg"
   164     "Modified: / 24-08-2017 / 21:32:52 / cg"
   167     "Modified: / 03-07-2018 / 13:41:45 / sr"
   165     "Modified: / 03-07-2018 / 13:41:45 / sr"
       
   166     "Modified: / 05-06-2019 / 17:06:15 / Claus Gittinger"
   168 !
   167 !
   169 
   168 
   170 postKeyPress:key
   169 postKeyPress:key
   171     |doComplete|
   170     |doComplete|
   172 
   171