(view)
| 1377 | } |
| 1378 | |
| 1379 | function selectWordCommand(view) { |
| 1380 | const resolvedView = resolveView(view); |
| 1381 | if (!resolvedView) return false; |
| 1382 | const { state } = resolvedView; |
| 1383 | const ranges = state.selection.ranges.map((range) => { |
| 1384 | const word = state.wordAt(range.head); |
| 1385 | if (word) return EditorSelection.range(word.from, word.to); |
| 1386 | const line = state.doc.lineAt(range.head); |
| 1387 | return EditorSelection.range(line.from, line.to); |
| 1388 | }); |
| 1389 | resolvedView.dispatch({ |
| 1390 | selection: EditorSelection.create(ranges, state.selection.mainIndex), |
| 1391 | }); |
| 1392 | return true; |
| 1393 | } |
| 1394 | |
| 1395 | async function openInAppBrowserCommand() { |
| 1396 | const url = await prompt("Enter url", "", "url", { |
nothing calls this directly
no test coverage detected