Fix @autocomplete closing after one character
Typing e.g. "@a" would work, but "@ab" would always instantly close the autocompletion UI if the cursor was at the end of the text area.
This commit is contained in:
parent
65f1cfe0c5
commit
bc3d6d902f
|
@ -159,12 +159,13 @@ HListView {
|
|||
const start = root.wordToComplete.start
|
||||
let end = root.wordToComplete.end + 1
|
||||
|
||||
if (currentIndex !== -1) {
|
||||
const member = model.get(currentIndex)
|
||||
if (root.currentIndex !== -1) {
|
||||
const member = root.model.get(root.currentIndex)
|
||||
const repl = member.display_name || member.id
|
||||
end = root.wordToComplete.start + repl.length
|
||||
}
|
||||
|
||||
if (pos === root.textArea.length) return
|
||||
if (pos < start || pos > end) root.accept()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user