#BUGFIX by exept
class: EditTextViewCompletionSupport
changed: #openCompletionView:
race
--- a/EditTextViewCompletionSupport.st Fri Sep 20 14:19:34 2019 +0200
+++ b/EditTextViewCompletionSupport.st Fri Sep 20 15:35:57 2019 +0200
@@ -449,11 +449,15 @@
openCompletionView: list
"Makes sure the completion view is opened and with given `list`."
- | textCursorPosInTextView textCursorPosOnScreen movePos topView|
+ |cursorX cursorY textCursorPosInTextView textCursorPosOnScreen movePos topView|
+
+ 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 := editView xOfCursor @ editView yOfCursor.
+ textCursorPosInTextView := cursorX @ cursorY.
"/ care for the scroll-offset (xOfCursor/yOFCursor gives me
textCursorPosInTextView := textCursorPosInTextView - (editView viewOrigin x @ 0).