Skip to content

Commit

Permalink
devtools: do not call updateSuggestions when anchorBox is null
Browse files Browse the repository at this point in the history
fixes #28
  • Loading branch information
darwin committed Jul 30, 2016
1 parent 951125a commit ab7c7ea
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions resources/unpacked/devtools/front_end/console/DiracPrompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,19 @@ WebInspector.DiracPromptWithHistory.prototype = {

this._lastExpression = expression;
this._updateAnchorBox();
const shouldShowForSingleItem = true; // later maybe implement inline completions like in TextPrompt.js

if (dirac._DEBUG_COMPLETIONS) {
console.log("calling SuggestBox.updateSuggestions", this._anchorBox, annotatedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);
if (this._anchorBox) {
const shouldShowForSingleItem = true; // later maybe implement inline completions like in TextPrompt.js

if (dirac._DEBUG_COMPLETIONS) {
console.log("calling SuggestBox.updateSuggestions", this._anchorBox, annotatedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);
}
this._suggestBox.updateSuggestions(this._anchorBox, annotatedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);
} else {
if (dirac._DEBUG_COMPLETIONS) {
console.log("not calling SuggestBox.updateSuggestions because this._anchorBox is null", annotatedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);
}
}
this._suggestBox.updateSuggestions(this._anchorBox, annotatedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);

// here could be implemented inline completions like in TextPrompt.js
},
Expand Down Expand Up @@ -730,11 +737,17 @@ WebInspector.DiracPromptWithHistory.prototype = {
if (this._suggestBox) {
this._lastExpression = expression;
this._updateAnchorBox();
const shouldShowForSingleItem = true; // later maybe implement inline completions like in TextPrompt.js
if (dirac._DEBUG_COMPLETIONS) {
console.log("calling SuggestBox.updateSuggestions", this._anchorBox, processedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);
if (this._anchorBox) {
const shouldShowForSingleItem = true; // later maybe implement inline completions like in TextPrompt.js
if (dirac._DEBUG_COMPLETIONS) {
console.log("calling SuggestBox.updateSuggestions", this._anchorBox, processedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);
}
this._suggestBox.updateSuggestions(this._anchorBox, processedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);
} else {
if (dirac._DEBUG_COMPLETIONS) {
console.log("not calling SuggestBox.updateSuggestions because this._anchorBox is null", processedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);
}
}
this._suggestBox.updateSuggestions(this._anchorBox, processedCompletions, selectedIndex, shouldShowForSingleItem, this._userEnteredText);
}

// here could be implemented inline completions like in TextPrompt.js
Expand Down

0 comments on commit ab7c7ea

Please sign in to comment.