Skip to content

Commit 73d4164

Browse files
Rename incorrect usage of targets (#1513)
## 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 2c394c0 commit 73d4164

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/actions/find.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
@mod.action_class
77
class Actions:
8-
def cursorless_private_run_find_action(targets: dict):
9-
"""Find text of targets in editor"""
8+
def cursorless_private_run_find_action(target: dict):
9+
"""Find text of target in editor"""

src/actions/homophones.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
from .get_text import get_text
44

55

6-
def run_homophones_action(targets: dict):
6+
def run_homophones_action(target: dict):
77
"""Replaced target with next homophone"""
8-
texts = get_text(targets, show_decorations=False)
8+
texts = get_text(target, show_decorations=False)
99
try:
1010
updated_texts = list(map(get_next_homophone, texts))
1111
except LookupError as e:
1212
app.notify(str(e))
1313
return
14-
actions.user.cursorless_replace(targets, updated_texts)
14+
actions.user.cursorless_replace(target, updated_texts)
1515

1616

1717
def get_next_homophone(word: str):

src/actions/reformat.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
@mod.action_class
1111
class Actions:
12-
def cursorless_reformat(targets: dict, formatters: str):
13-
"""Reformat targets with formatter"""
14-
texts = get_text(targets, show_decorations=False)
12+
def cursorless_reformat(target: dict, formatters: str):
13+
"""Reformat target with formatter"""
14+
texts = get_text(target, show_decorations=False)
1515
updated_texts = [actions.user.reformat_text(text, formatters) for text in texts]
16-
actions.user.cursorless_replace(targets, updated_texts)
16+
actions.user.cursorless_replace(target, updated_texts)

src/actions/wrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ def parse_snippet_location(snippet_location: str) -> tuple[str, str]:
6565

6666
@mod.action_class
6767
class Actions:
68-
def cursorless_wrap(action_type: str, targets: dict, cursorless_wrapper: Wrapper):
68+
def cursorless_wrap(action_type: str, target: dict, cursorless_wrapper: Wrapper):
6969
"""Perform cursorless wrap action"""
7070
wrapper_type = cursorless_wrapper.type
7171
action = action_map[(action_type, wrapper_type)]
7272

7373
actions.user.cursorless_single_target_command_with_arg_list(
74-
action, targets, cursorless_wrapper.extra_args
74+
action, target, cursorless_wrapper.extra_args
7575
)

src/apps/cursorless_vscode.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
@ctx.action_class("user")
1616
class Actions:
17-
def cursorless_private_run_find_action(targets: dict):
18-
"""Find text of targets in editor"""
19-
texts = get_text(targets, ensure_single_target=True)
17+
def cursorless_private_run_find_action(target: dict):
18+
"""Find text of target in editor"""
19+
texts = get_text(target, ensure_single_target=True)
2020
search_text = texts[0]
2121
if len(search_text) > 200:
2222
search_text = search_text[:200]

0 commit comments

Comments
 (0)