Skip to content

Commit f193854

Browse files
authored
improve comment
1 parent 95c610c commit f193854

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_src/js/features/comp/TextExpander.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ export function initTextExpander(expander: TextExpanderElement) {
6363
// https://github.com/github/text-expander-element/issues/71
6464
// Upstream bug: when using "multiword+promise", TextExpander will get wrong "key" position.
6565
// To reproduce, comment out the "shouldShowIssueSuggestions" check, use the "await sleep" below,
66-
// then use content "close #20\nclose #20\close #20", keep changing the last line `#20` part from the end (including removing the `#`)
66+
// then use content "close #20\nclose #20\nclose #20" (3 lines), keep changing the last line `#20` part from the end (including removing the `#`)
6767
// There will be a JS error: Uncaught (in promise) IndexSizeError: Failed to execute 'setStart' on 'Range': The offset 28 is larger than the node's length (27).
6868

6969
// check the input before the request, to avoid emitting empty query to backend (still related to the upstream bug)
7070
if (!shouldShowIssueSuggestions()) return {matched: false};
7171
// await sleep(Math.random() * 1000); // help to reproduce the text-expander bug
7272
const ret = await fetchIssueSuggestions(key, text);
73-
// check the input again to avoid text-expander use incorrect position (upstream bug)
73+
// check the input again to avoid text-expander using incorrect position (upstream bug)
7474
if (!shouldShowIssueSuggestions()) return {matched: false};
7575
return ret;
7676
}, 300); // to match onInputDebounce delay

0 commit comments

Comments
 (0)