Skip to content

Commit e082a97

Browse files
authored
Limit the amount of text used in scout and scout all (#1157)
Fixes #943 ## Checklist - [ ] 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) - [ ] I have not broken the cheatsheet
1 parent d18bce3 commit e082a97

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/apps/cursorless_vscode.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from talon import Context, actions
1+
from talon import Context, actions, app
22

33
from ..actions.get_text import get_text
44
from ..cursorless_command_server import run_rpc_command_no_wait
@@ -17,9 +17,13 @@ class Actions:
1717
def cursorless_private_run_find_action(targets: dict):
1818
"""Find text of targets in editor"""
1919
texts = get_text(targets, 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")
2024
run_rpc_command_no_wait("actions.find")
2125
actions.sleep("50ms")
22-
actions.insert(texts[0])
26+
actions.insert(search_text)
2327

2428
def cursorless_show_settings_in_ide():
2529
"""Show Cursorless-specific settings in ide"""

0 commit comments

Comments
 (0)