Fix text completion

This commit is contained in:
1024jp 2016-10-07 02:55:24 +09:00
parent e84b4f2ced
commit 8632cd1394
2 changed files with 12 additions and 2 deletions

View File

@ -2,7 +2,16 @@
Change Log
==========================
3.0.1 (159)
develop
--------------------------
### Fixes
- Fix an issue where text completion list did occasionally not displayed.
3.0.1 (160)
--------------------------
### Fixes

View File

@ -1311,10 +1311,11 @@ extension EditorTextView {
// abord if:
guard !self.hasMarkedText(), // input is not specified (for Japanese input)
self.selectedRange.length == 0, // selected
let nextCharacter = self.characterAfterInsertion, !CharacterSet.alphanumerics.contains(nextCharacter), // caret is (probably) at the middle of a word
let lastCharacter = self.characterBeforeInsertion, !CharacterSet.whitespacesAndNewlines.contains(lastCharacter) // previous character is blank
else { return }
if let nextCharacter = self.characterAfterInsertion, CharacterSet.alphanumerics.contains(nextCharacter) { return } // caret is (probably) at the middle of a word
self.complete(self)
}