MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / doSearch

Method doSearch

src/code_view.ts:225–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

setupEventListenersMethod · 0.95

Calls 2

getQueryMethod · 0.95
findNextMethod · 0.95

Tested by

no test coverage detected