MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / clearSelection

Function clearSelection

src/cm/editorUtils.ts:161–172  ·  view source on GitHub ↗
(view: EditorView)

Source from the content-addressed store, hash-verified

159 * Clear selection, keeping only cursor position
160 */
161export function clearSelection(view: EditorView): void {
162 view.dispatch({
163 selection: EditorSelection.single(view.state.selection.main.head),
164 scrollIntoView: true,
165 });
166 // Also clear the global DOM selection to prevent native selection handles/menus persisting
167 try {
168 document.getSelection()?.removeAllRanges();
169 } catch (_) {
170 // Ignore errors
171 }
172}
173
174export default {
175 getAllFolds,

Callers 1

editorFile.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected