diff -r 01e458f0958f -r 05ed2f6a11ab Tools__CodeNavigationService.st --- a/Tools__CodeNavigationService.st Wed Sep 18 15:45:33 2013 +0200 +++ b/Tools__CodeNavigationService.st Wed Sep 18 16:20:55 2013 +0200 @@ -293,11 +293,37 @@ ! findNextVariableFromCursor + | currentElement nextElement | + + codeView hasSelection ifTrue:[ + currentElement := self elementAtLine: textView selectionStartLine col: textView selectionStartCol. + ] ifFalse:[ + currentElement := codeView syntaxElementSelection. + ]. + currentElement isVariable ifTrue:[ + nextElement := currentElement next. + nextElement notNil ifTrue:[ + textView selectFrom: nextElement start to: nextElement stop. + ] + ] "Created: / 18-09-2013 / 13:15:28 / Jan Vrany " ! findPreviousVariableFromCursor + | currentElement prevElement | + + codeView hasSelection ifTrue:[ + currentElement := self elementAtLine: textView selectionStartLine col: textView selectionStartCol. + ] ifFalse:[ + currentElement := codeView syntaxElementSelection. + ]. + currentElement isVariable ifTrue:[ + prevElement := currentElement prev. + prevElement notNil ifTrue:[ + textView selectFrom: prevElement start to: prevElement stop. + ] + ] "Created: / 18-09-2013 / 13:15:50 / Jan Vrany " ! @@ -355,29 +381,32 @@ "/ ^ false "/ ]. - sensor metaDown ifTrue:[ - (key == #CursorRight or:[key == #CursorDown]) ifTrue:[ - sensor pushUserEvent:#findNextVariableFromCursor for:self. - ] ifFalse:[(key == #CursorLeft or:[key == #CursorUp]) ifTrue:[ - sensor pushUserEvent:#findPreviousVariableFromCursor for:self. - ]]. + + (key == #FocusNext) ifTrue:[ + sensor pushUserEvent:#findNextVariableFromCursor for:self. + ^ true. + ]. + (key == #FocusPrevious) ifTrue:[ + sensor pushUserEvent:#findPreviousVariableFromCursor for:self. + ^ true. + ]. + + (key == #CursorRight + or:[key == #CursorDown + or:[key == #CursorLeft + or:[key == #CursorUp]]] + ) ifTrue:[ + sensor pushUserEvent:#highlightVariableAtCursor for:self . ] ifFalse:[ - (key == #CursorRight - or:[key == #CursorDown - or:[key == #CursorLeft - or:[key == #CursorUp]]] - ) ifTrue:[ - sensor pushUserEvent:#highlightVariableAtCursor for:self . - ] ifFalse:[ - "/ sensor pushUserEvent:#highlightClear for:self . - ] + "/ sensor pushUserEvent:#highlightClear for:self . ] + ]. ^ false "Created: / 06-03-2010 / 20:50:45 / Jan Vrany " "Modified: / 05-09-2011 / 05:17:30 / cg" - "Modified: / 27-09-2011 / 19:24:13 / Jan Vrany " + "Modified: / 18-09-2013 / 15:20:09 / Jan Vrany " ! keyRelease: key x:x y:y in: view @@ -771,14 +800,14 @@ !CodeNavigationService class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeNavigationService.st,v 1.38 2013-09-18 13:24:31 vrany Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeNavigationService.st,v 1.39 2013-09-18 14:20:55 vrany Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeNavigationService.st,v 1.38 2013-09-18 13:24:31 vrany Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeNavigationService.st,v 1.39 2013-09-18 14:20:55 vrany Exp $' ! version_SVN - ^ '$Id: Tools__CodeNavigationService.st,v 1.38 2013-09-18 13:24:31 vrany Exp $' + ^ '$Id: Tools__CodeNavigationService.st,v 1.39 2013-09-18 14:20:55 vrany Exp $' ! !