Move onError catch into searchAt
This commit is contained in:
parent
1039536cfb
commit
d608657495
@ -99,11 +99,7 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const search = async () => {
|
const search = async () => {
|
||||||
try {
|
|
||||||
await this.searchAt(e.clientX, e.clientY, 'mouse');
|
await this.searchAt(e.clientX, e.clientY, 'mouse');
|
||||||
} catch (e) {
|
|
||||||
this.onError(e);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (scanningModifier === 'none') {
|
if (scanningModifier === 'none') {
|
||||||
@ -314,12 +310,16 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async searchAt(x, y, cause) {
|
async searchAt(x, y, cause) {
|
||||||
|
try {
|
||||||
if (this.pendingLookup || await this.popup.containsPoint(x, y)) {
|
if (this.pendingLookup || await this.popup.containsPoint(x, y)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const textSource = docRangeFromPoint(x, y, this.options);
|
const textSource = docRangeFromPoint(x, y, this.options);
|
||||||
return await this.searchSource(textSource, cause);
|
return await this.searchSource(textSource, cause);
|
||||||
|
} catch (e) {
|
||||||
|
this.onError(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async searchSource(textSource, cause) {
|
async searchSource(textSource, cause) {
|
||||||
@ -503,15 +503,7 @@ class Frontend {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = async () => {
|
this.searchAt(x, y, cause);
|
||||||
try {
|
|
||||||
await this.searchAt(x, y, cause);
|
|
||||||
} catch (e) {
|
|
||||||
this.onError(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
search();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
selectionContainsPoint(selection, x, y) {
|
selectionContainsPoint(selection, x, y) {
|
||||||
|
Loading…
Reference in New Issue
Block a user