node-automator 1.4.21 → 1.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-automator",
3
- "version": "1.4.21",
3
+ "version": "1.4.22",
4
4
  "description": "Execute automation with yaml configuration(compatible with json)",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -209,10 +209,9 @@ function showOptions(viewOptions, filteredViewOptions, selectedIndices, focusedI
209
209
  // 清空本行
210
210
  clearLine();
211
211
  let preview = omit_offset(viewOptionStr, 2);
212
- if (searchChars) {
213
- preview = preview.replaceAll(searchChars, searchChars["red"]);
214
- }
215
- write(`${indicator}${preview[optionColor]}`);
212
+ const previewParts = preview.split(searchChars);
213
+ preview = previewParts.map(v => v[optionColor]).join(searchChars["bold"]);
214
+ write(`${indicator}${preview}`);
216
215
  write('\n');
217
216
  }
218
217
  write(`${begIndex + numShow >= filteredViewOptions.length ? "" : "▼"['magenta']}${clear_line_end}\n`);