Skip to content

Commit 33cb201

Browse files
autocomplete crash fix on CTRL without available variants
1 parent ebd31d9 commit 33cb201

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

webSource/js/TerminalInput.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ TerminalInput.prototype.getCurrentAutocompleteVariant = function () {
226226
TerminalInput.prototype._changeAutocompleteVariant = function (delta) {
227227

228228
this._currentAutocompleteVariant = (this._currentAutocompleteVariant + delta)
229-
% this._autocompleteVariants.length;
229+
% this._autocompleteVariants.length || 0;
230230
if (this._currentAutocompleteVariant < 0) this._currentAutocompleteVariant
231231
+= this._autocompleteVariants.length;
232232
this._updateAutocompleteView();
@@ -243,6 +243,8 @@ TerminalInput.prototype._updateAutocompleteView = function () {
243243

244244
var variant = this.getCurrentAutocompleteVariant();
245245

246+
console.log(variant, this._autocompleteHint);
247+
246248
if (!variant) {
247249
this._autocompleteHint.hide();
248250
return;

0 commit comments

Comments
 (0)