--- a/EditTextViewCompletionSupport.st Thu Oct 24 17:42:59 2019 +0200
+++ b/EditTextViewCompletionSupport.st Thu Oct 24 18:45:44 2019 +0200
@@ -228,8 +228,14 @@
editViewLostFocusBlock isNil ifTrue:[
editViewLostFocusBlock := [self editViewLostFocus].
+"/ Pro: This saves some warnings about timeout for dead process.
+"/ Con: Can add more than a single exit action
+"/ Processor activeProcess
+"/ addExitAction:[Processor removeTimedBlock:editViewLostFocusBlock].
].
Processor addTimedBlock:editViewLostFocusBlock afterMilliseconds:200.
+
+ "Modified: / 24-10-2019 / 18:44:41 / Stefan Vogel"
! !
!EditTextViewCompletionSupport methodsFor:'private'!
@@ -372,7 +378,7 @@
|screenBounds screenBoundsCorner
helpViewsExtent helpViewsWidth helpViewsHeight
textCursorPosInTextView textCursorPosOnScreen
- newX newY cursorX cursorY distanceFromCursorIfBelow distanceFromCursorIfAbove |
+ newX newY cursorX cursorY distanceFromCursorIfBelow distanceFromCursorIfAbove|
textCursorPosInTextView := editView xOfCursor @ editView yOfCursor.
textCursorPosOnScreen := editView device
@@ -387,7 +393,7 @@
topView resizeToFit.
"/ make sure, the window is visible
- screenBounds := topView device monitorBoundsAt:topView origin.
+ screenBounds := topView device monitorBoundsAt:editView topView origin.
screenBoundsCorner := screenBounds corner.
helpViewsExtent := topView extent.
@@ -422,6 +428,8 @@
"/ ].
].
topView origin:(newX @ newY).
+
+ "Modified: / 24-10-2019 / 18:41:07 / Stefan Vogel"
!
closeCompletionView
@@ -453,24 +461,25 @@
"/ race here - openCompletionView may arrive late, when the user started to do something else
"/ (scroll or select). Then it could happen the no cursor is currently visible.
- cursorX := editView xOfCursor.
- cursorY := editView yOfCursor.
- (cursorX isNil or:[cursorY isNil]) ifTrue:[^ self].
-
- "/ move the window away from the text cursor (to not cover what user types in)
- "/ get the screen-relative position of the text cursor
- textCursorPosInTextView := cursorX @ cursorY.
-
- "/ care for the scroll-offset (xOfCursor/yOFCursor gives me
- textCursorPosInTextView := textCursorPosInTextView - (editView viewOrigin x @ 0).
-
- textCursorPosOnScreen := editView device
- translatePoint:textCursorPosInTextView
- fromView:editView toView:nil.
-
- "/ currently, we have to stay away a bit, to avoid getting the focus
- "/ this will be somewhat to the down-right of the textCursor
- movePos := textCursorPosOnScreen + (60 @ (editView font height)).
+"/ Disable dead code:
+"/ cursorX := editView xOfCursor.
+"/ cursorY := editView yOfCursor.
+"/ (cursorX isNil or:[cursorY isNil]) ifTrue:[^ self].
+"/
+"/ "/ move the window away from the text cursor (to not cover what user types in)
+"/ "/ get the screen-relative position of the text cursor
+"/ textCursorPosInTextView := cursorX @ cursorY.
+"/
+"/ "/ care for the scroll-offset (xOfCursor/yOFCursor gives me
+"/ textCursorPosInTextView := textCursorPosInTextView - (editView viewOrigin x @ 0).
+"/
+"/ textCursorPosOnScreen := editView device
+"/ translatePoint:textCursorPosInTextView
+"/ fromView:editView toView:nil.
+"/
+"/ "/ currently, we have to stay away a bit, to avoid getting the focus
+"/ "/ this will be somewhat to the down-right of the textCursor
+"/ movePos := textCursorPosOnScreen + (60 @ (editView font height)).
completionView isNil ifTrue:[
completionView := CodeCompletionHelpMenuView new.
@@ -493,6 +502,7 @@
].
"Created: / 26-09-2013 / 17:07:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 24-10-2019 / 17:57:57 / Stefan Vogel"
! !