#REFACTORING by exept
class: SmallSense::EditSupport
changed:
#wordBeforeCursor
#wordBeforeCursorConsisitingOfCharactersMatching:
--- a/SmallSense__EditSupport.st Fri Aug 02 17:46:33 2019 +0200
+++ b/SmallSense__EditSupport.st Wed Aug 14 16:46:47 2019 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
Copyright (C) 2013-2014 Jan Vrany
@@ -403,32 +405,14 @@
!
wordBeforeCursor
- ^ self wordBeforeCursorConsisitingOfCharactersMatching: [:c | c isAlphaNumeric ].
+ ^ textView wordBeforeCursor.
"Created: / 27-09-2013 / 15:53:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 31-03-2014 / 23:03:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-wordBeforeCursorConsisitingOfCharactersMatching: characterMatchBlock
- | currentLine wordStart wordEnd |
- currentLine := textView list at: textView cursorLine ifAbsent:[ ^ '' ].
- currentLine isNil ifTrue:[ ^ '' ].
- wordEnd := textView cursorCol - 1.
- wordEnd > currentLine size ifTrue:[ ^ '' ].
- wordEnd ~~ 0 ifTrue:[
- wordStart := wordEnd.
- [ wordStart > 0 and:[characterMatchBlock value:(currentLine at: wordStart) ] ] whileTrue:[
- wordStart := wordStart - 1.
- ].
- wordStart := wordStart + 1.
- wordStart <= wordEnd ifTrue:[
- ^ currentLine copyFrom: wordStart to: wordEnd.
- ].
- ].
- ^ ''
-
- "Created: / 31-03-2014 / 23:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 17-06-2014 / 07:27:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+wordBeforeCursorConsisitingOfCharactersMatching:characterMatchBlock
+ ^ textView wordBeforeCursorConsisitingOfCharactersMatching:characterMatchBlock
! !
!EditSupport methodsFor:'private-scanning'!