ibusCandidatePopup: Clarify assignment in condition
Most often it is a bug if the condition part of a for-loop contains the assignment operator rather than the comparison one, so tools rightfully emit a warning. Clarify that the assignment is intentional in this case by adding parentheses. Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375
This commit is contained in:
parent
c264cc4131
commit
a9ed128dce
@ -236,7 +236,7 @@ var CandidatePopup = class CandidatePopup {
|
|||||||
|
|
||||||
let indexes = [];
|
let indexes = [];
|
||||||
let indexLabel;
|
let indexLabel;
|
||||||
for (let i = 0; indexLabel = lookupTable.get_label(i); ++i)
|
for (let i = 0; (indexLabel = lookupTable.get_label(i)); ++i)
|
||||||
indexes.push(indexLabel.get_text());
|
indexes.push(indexLabel.get_text());
|
||||||
|
|
||||||
Main.keyboard.resetSuggestions();
|
Main.keyboard.resetSuggestions();
|
||||||
@ -295,7 +295,7 @@ var CandidatePopup = class CandidatePopup {
|
|||||||
|
|
||||||
_setTextAttributes(clutterText, ibusAttrList) {
|
_setTextAttributes(clutterText, ibusAttrList) {
|
||||||
let attr;
|
let attr;
|
||||||
for (let i = 0; attr = ibusAttrList.get(i); ++i)
|
for (let i = 0; (attr = ibusAttrList.get(i)); ++i)
|
||||||
if (attr.get_attr_type() == IBus.AttrType.BACKGROUND)
|
if (attr.get_attr_type() == IBus.AttrType.BACKGROUND)
|
||||||
clutterText.set_selection(attr.get_start_index(), attr.get_end_index());
|
clutterText.set_selection(attr.get_start_index(), attr.get_end_index());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user