Don't show ghost text if curLine is empty (#674)

This commit is contained in:
Evan Simkowitz 2024-06-07 17:40:50 -07:00 committed by GitHub
parent 067bef0cb5
commit 29ad232ac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -187,9 +187,7 @@ export class AutocompleteModel {
* @see getPrimarySuggestionIndex
*/
getPrimarySuggestionCompletion(): string {
if (!this.isEnabled) {
return null;
}
if (!this.isEnabled || !this.globalModel.inputModel.curLine) return null;
const suggestionIndex = this.getPrimarySuggestionIndex();
const retVal = this.getSuggestionCompletion(suggestionIndex);
if (retVal) {