()
| 223 | } |
| 224 | |
| 225 | private doSearch() { |
| 226 | const query = this.getQuery(); |
| 227 | |
| 228 | if (!query.search) { |
| 229 | // 清空搜索时,清除选中状态 |
| 230 | const { from, to } = this.view.state.selection.main; |
| 231 | if (from !== to) { |
| 232 | this.view.dispatch({ |
| 233 | selection: { anchor: from, head: from } |
| 234 | }); |
| 235 | } |
| 236 | return; |
| 237 | } |
| 238 | |
| 239 | // 执行搜索 - 从当前位置开始查找第一个匹配 |
| 240 | this.findNext(); |
| 241 | } |
| 242 | |
| 243 | private findNext() { |
| 244 | const query = this.getQuery(); |
no test coverage detected