Skip to content

Commit b0cf2d6

Browse files
AndreasArvidssonpre-commit-ci-lite[bot]
authored andcommitted
Added proper find in document implementation (#2143)
Learned of the existence of vscode command `editor.actions.findWithArgs` microsoft/vscode#200453 Exists in v1.66 https://github.com/microsoft/vscode/blob/release/1.66/src/vs/editor/contrib/find/browser/findModel.ts#L58 Fixes #1878 ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [x] I have not broken the cheatsheet --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent f5df6dc commit b0cf2d6

File tree

4 files changed

+2
-28
lines changed

4 files changed

+2
-28
lines changed

src/actions/actions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
]
5050

5151
callback_actions: dict[str, Callable[[CursorlessTarget], None]] = {
52-
"findInDocument": actions.user.private_cursorless_find,
5352
"nextHomophone": cursorless_homophones_action,
5453
}
5554

src/actions/find.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/apps/cursorless_vscode.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
from talon import Context, actions, app
2-
3-
from ..actions.get_text import cursorless_get_text_action
4-
from ..targets.target_types import CursorlessTarget
1+
from talon import Context, actions
52

63
ctx = Context()
74

@@ -14,17 +11,6 @@
1411

1512
@ctx.action_class("user")
1613
class Actions:
17-
def private_cursorless_find(target: CursorlessTarget):
18-
"""Find text of target in editor"""
19-
texts = cursorless_get_text_action(target, ensure_single_target=True)
20-
search_text = texts[0]
21-
if len(search_text) > 200:
22-
search_text = search_text[:200]
23-
app.notify("Search text is longer than 200 characters; truncating")
24-
actions.user.private_cursorless_run_rpc_command_no_wait("actions.find")
25-
actions.sleep("50ms")
26-
actions.insert(search_text)
27-
2814
def private_cursorless_show_settings_in_ide():
2915
"""Show Cursorless-specific settings in ide"""
3016
actions.user.private_cursorless_run_rpc_command_no_wait(

src/spoken_forms.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"reference": "showReferences",
3737
"rename": "rename",
3838
"reverse": "reverseTargets",
39+
"scout": "findInDocument",
3940
"scout all": "findInWorkspace",
4041
"shuffle": "randomizeTargets",
4142
"snippet make": "generateSnippet",
@@ -45,7 +46,6 @@
4546
"unfold": "unfoldRegion"
4647
},
4748
"callback_action": {
48-
"scout": "findInDocument",
4949
"phones": "nextHomophone"
5050
},
5151
"paste_action": { "paste": "pasteFromClipboard" },

0 commit comments

Comments
 (0)