Ensure one history completion for real

This commit is contained in:
Oliver Blanthorn 2019-06-06 10:41:17 +01:00
parent 2485b1d2c2
commit 32ac11fe9d

View file

@ -89,7 +89,10 @@ export class HistoryCompletionSource extends Completions.CompletionSourceFuse {
// ago, then reselect it so that users don't lose their selections.
this.options.forEach(option => option.state = "normal")
for (const option of this.options) {
if (lastFocused !== undefined && lastFocused.value === option.value) this.select(option)
if (lastFocused !== undefined && lastFocused.value === option.value) {
this.select(option)
break
}
}
return this.updateDisplay()