Skip to content

Commit

Permalink
Reimplement PR #1192 (#1588)
Browse files Browse the repository at this point in the history
Reimplement #1192 using the new compound edit actions

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
knausj85 and pre-commit-ci[bot] authored Nov 9, 2024
1 parent b4e7a36 commit 742d3aa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
21 changes: 0 additions & 21 deletions core/edit/edit.talon
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ select down: edit.extend_line_down()
select word left: edit.extend_word_left()
select word right: edit.extend_word_right()

select way left: edit.extend_line_start()
select way right: edit.extend_line_end()
select way up: edit.extend_file_start()
select way down: edit.extend_file_end()

# Indentation
indent [more]: edit.indent_more()
(indent less | out dent): edit.indent_less()
Expand All @@ -76,22 +71,6 @@ clear word right:
edit.extend_word_right()
edit.delete()

clear way left:
edit.extend_line_start()
edit.delete()

clear way right:
edit.extend_line_end()
edit.delete()

clear way up:
edit.extend_file_start()
edit.delete()

clear way down:
edit.extend_file_end()
edit.delete()

# Copy
copy that: edit.copy()
copy word left: user.copy_word_left()
Expand Down
2 changes: 2 additions & 0 deletions core/edit/edit_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
("goBefore", "line"): actions.edit.line_start,
("goBefore", "paragraph"): actions.edit.paragraph_start,
("goBefore", "document"): actions.edit.file_start,
("goBefore", "fileStart"): actions.edit.file_start,
# Go after
("goAfter", "line"): actions.edit.line_end,
("goAfter", "paragraph"): actions.edit.paragraph_end,
("goAfter", "document"): actions.edit.file_end,
("goAfter", "fileEnd"): actions.edit.file_end,
# Delete
("delete", "word"): actions.edit.delete_word,
("delete", "line"): actions.edit.delete_line,
Expand Down
2 changes: 2 additions & 0 deletions core/edit/edit_command_modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def edit_modifier(m) -> EditModifier:
"line": actions.edit.select_line,
"lineEnd": actions.user.select_line_end,
"lineStart": actions.user.select_line_start,
"fileStart": actions.edit.extend_file_start,
"fileEnd": actions.edit.extend_file_end,
}


Expand Down
8 changes: 6 additions & 2 deletions core/edit/edit_command_modifiers.talon-list
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
list: user.edit_modifier
-

all: document
paragraph: paragraph
word: word

line: line
line start: lineStart
way left: lineStart
line end: lineEnd
way right: lineEnd
file start: fileStart
way up: fileStart
file end: fileEnd
way down: fileEnd

0 comments on commit 742d3aa

Please sign in to comment.