-
Notifications
You must be signed in to change notification settings - Fork 72
FindWidget
github-actions[bot] edited this page May 16, 2024
·
3 revisions
// open the find widget from text editor
const editor = new TextEditor();
const widget = await editor.openFindWidget();
// set search text
await widget.setSearchText();
// get search text
const text = await widget.getSearchText();
// find next
await widget.nextMatch();
// find previous
await widget.previousMatch();
// get result counts
const counts = await widget.getResultCount();
const currentResultNumber = counts[0];
const totalCount = counts[1];
// toggle replace on/off
await widget.toggleReplace(true); // or false
// set replace text
await widget.setReplaceText();
// get replace text
const text = await widget.getReplaceText();
// replace current match
await widget.replace();
// replace all matches
await widget.replaceAll();
// switch 'Match Case' on/off
await widget.toggleMatchCase(true / false);
// switch 'Match Whole Word' on/off
await widget.toggleMatchWholeWord(true / false);
// switch 'Use Regular Expression' on/off
await widget.toggleUseRegularExpression(true / false);
// switch 'Preserve Case' on/off
await widget.togglePreserveCase(true / false);
await widget.close();