Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnicollo committed Oct 21, 2024
2 parents 95f9ac2 + 25f35f3 commit 816e82b
Show file tree
Hide file tree
Showing 134 changed files with 3,228 additions and 1,285 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ __pycache__
/settings
.vscode/settings.json
.DS_Store

.bak
# Generated by GoodSync
/_gsdata_/
/click_talon/_gsdata_/
/personal_extras/_gsdata_/
/personal_extras/_gsdata_/
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
minimum_pre_commit_version: "3.2.0"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -35,7 +35,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/Lucas-C/pre-commit-hooks
Expand Down
55 changes: 40 additions & 15 deletions BREAKING_CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
This file lists known changes to `community` that are likely to have broken existing
functionality. The file is sorted by date with the newest entries up the top.
This file lists known changes to `community` that are likely to have
broken existing functionality. The file is sorted by date with the
newest entries up the top.

Be aware there may be some difference between the date in this file and when the change was
applied given the delay between changes being submitted and the time they were reviewed
and merged.
Be aware there may be some difference between the date in this file
and when the change was applied given the delay between changes being
submitted and the time they were reviewed and merged.

---
* 2024-05-30 Deprecate 'drop down <user.number_small>' in favor of overridable 'choose' helper
* 2024-01-27 Deprecate '<user.number_string>' command without a spoken prefix like `numb`.
See `numbers.talon` and `numbers_unprefixed.talon.` If in the future you want to still use
unprefixed numbers, you will need to comment out the
`tag(): user.prefixed_numbers` line in your `settings.talon` file.
* 2023-06-06 Deprecate `go ` command for VSCode. Use 'bar marks' instead.
* 2024-09-07 Removed `get_list_from_csv` from `user_settings.py`. Please
use the new `track_csv_list` decorator, which leverages Talon's
`talon.watch` API for robustness on Talon launch.
* 2024-09-07 If you've updated `community` since 2024-08-31, you may
need to replace `host:` with `hostname:` in the header of
`core/system_paths-<hostname>.talon-list` due to an issue with
automatic conversion from CSV (#1268).
* 2024-07-31 Remove commands `"command mode"`, `"dictation mode"` from
custom user modes. Note that if you have any custom modes where you
want these commands you could add that mode to the context of
`command_and_dictation_mode.talon` or copying the command to one of
your custom files.
* 2024-07-30 Deprecate `lend` and `bend` commands in favor of `go line
end | tail` and `go line start | head`.
* 2024-07-28 Removed the following user namespace actions in favor of
the new action/modifier grammar.
https://github.com/talonhub/community/blob/37a8ebde90c8120a0b52555030988d4f54e65159/core/edit/edit.talon#L3
cut_word, copy_word, paste_word
cut_all, copy_all, paste_all, delete_all
copy_line, paste_line
cut_line_start, copy_line_start, paste_line_start, delete_line_start
cut_line_end, copy_line_end, paste_line_end, delete_line_end
* 2024-05-30 Deprecate 'drop down <user.number_small>' in favor of
overridable 'choose' helper
* 2024-01-27 Deprecate '<user.number_string>' command without a spoken
prefix like `numb`. See `numbers.talon` and
`numbers_unprefixed.talon.` If in the future you want to still use
unprefixed numbers, you will need to comment out the
`tag(): user.prefixed_numbers` line in your `settings.talon` file.
* 2023-06-06 Deprecate `go` command for VSCode. Use 'bar marks' instead.
* 2023-02-04 Deprecate `murder` command for i3wm. Use 'win kill' instead.
* 2022-12-11 Deprecate user.insert_with_history. Just use `user.add_phrase_to_history(text);
insert(text)` instead. See #939.
* 2022-10-01 Large refactoring of code base that moves many files into new locations. No
other backwards-incompatible changes included.
* 2022-12-11 Deprecate user.insert_with_history. Just use
`user.add_phrase_to_history(text); insert(text)` instead. See #939.
* 2022-10-01 Large refactoring of code base that moves many files into
new locations. No other backwards-incompatible changes included.
204 changes: 111 additions & 93 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions apps/arc/arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def tab_close_wrapper():
actions.sleep("180ms")
actions.app.tab_close()

def command_search(command: str = ""):
actions.key("cmd-l")
if command != "":
actions.sleep("200ms")
actions.insert(command)


@ctx.action_class("browser")
class BrowserActions:
Expand Down
6 changes: 1 addition & 5 deletions apps/arc/arc_mac.talon
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ os: mac
-
tag(): browser
tag(): user.tabs

please [<user.text>]:
key("cmd-l")
sleep(200ms)
insert(user.text or "")
tag(): user.command_search
4 changes: 2 additions & 2 deletions apps/brave/brave.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

mod.apps.brave = "app.name: Brave Browser"
mod.apps.brave = "app.name: Brave-browser"
mod.apps.brave = """
mod.apps.brave = r"""
os: windows
and app.exe: brave.exe
and app.exe: /^brave\.exe$/i
os: linux
and app.exe: brave
os: mac
Expand Down
6 changes: 3 additions & 3 deletions apps/calibre/calibre.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

# --- App definition ---
mod = Module()
mod.apps.calibre = """
mod.apps.calibre = r"""
os: windows
and app.name: calibre.exe
os: windows
and app.exe: calibre.exe
and app.exe: /^calibre\.exe$/i
os: windows
and app.name: calibre-parallel.exe
os: windows
and app.exe: calibre-parallel.exe
and app.exe: /^calibre-parallel\.exe$/i
"""
mod.apps.calibre = """
os: linux
Expand Down
4 changes: 2 additions & 2 deletions apps/chrome/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
mod = Module()

mod.apps.chrome = "app.name: Google Chrome"
mod.apps.chrome = """
mod.apps.chrome = r"""
os: windows
and app.exe: chrome.exe
and app.exe: /^chrome\.exe$/i
"""
mod.apps.chrome = """
os: mac
Expand Down
5 changes: 1 addition & 4 deletions apps/eclipse/eclipse.talon
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ tag(): user.line_commands
# tag(): user.multiple_cursors
tag(): user.splits
tag(): user.tabs
tag(): user.command_search
# splits.py support end

please [<user.text>]:
key(ctrl-3)
insert(user.text or "")

# Sidebar
bar explore: key(alt-shift-w p)
# bar extensions:
Expand Down
30 changes: 10 additions & 20 deletions apps/eclipse/eclipse_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ def toggle_comment():

@ctx.action_class("edit")
class EditActions:
def find(text: str):
actions.key("ctrl-f")
actions.insert(text)
def find_next():
actions.key("enter")

def find_previous():
actions.key("shift-enter")

def line_swap_up():
actions.key("alt-up")
Expand Down Expand Up @@ -108,24 +110,12 @@ def split_window_vertically():
def split_window():
actions.key("alt-ctrl-s s")

# splits.py support end

# find.py support begin

def find(text: str):
"""Triggers find in current editor"""

actions.key("ctrl-f")
if text:
actions.insert(text)

def find_next():
actions.key("enter")
def command_search(command: str = ""):
actions.key("ctrl-3")
if command != "":
actions.insert(command)

def find_previous():
actions.key("shift-enter")

# find.py support end
# splits.py support end

# find_and_replace.py support begin

Expand Down
4 changes: 2 additions & 2 deletions apps/edge/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
mod = Module()
ctx = Context()

mod.apps.microsoft_edge = """
mod.apps.microsoft_edge = r"""
os: windows
and app.name: msedge.exe
os: windows
and app.name: Microsoft Edge
os: windows
and app.exe: msedge.exe
and app.exe: /^msedge\.exe$/i
os: mac
and app.bundle: com.microsoft.edgemac
os: linux
Expand Down
4 changes: 2 additions & 2 deletions apps/emacs/emacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
os: mac
app.bundle: org.gnu.Emacs
"""
mod.apps.emacs = """
mod.apps.emacs = r"""
os: windows
app.exe: emacs.exe
app.exe: /^emacs\.exe$/i
"""

ctx = Context()
Expand Down
13 changes: 4 additions & 9 deletions apps/emacs/emacs_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ def emacs_command_short_form(command_name: str) -> Optional[str]:
return emacs_commands.get(command_name, Command(command_name)).short


def load_csv():
filepath = Path(__file__).parents[0] / "emacs_commands.csv"
with resource.open(filepath) as f:
rows = list(csv.reader(f))
@resource.watch("emacs_commands.csv")
def load_commands(f):
rows = list(csv.reader(f))
# Check headers
assert rows[0] == ["Command", " Key binding", " Short form", " Spoken form"]

Expand All @@ -46,7 +45,7 @@ def load_csv():
continue
if len(row) > 4:
print(
f'"{filepath}": More than four values in row: {row}. '
f"emacs_commands.csv: More than four values in row: {row}. "
+ " Ignoring the extras"
)
name, keys, short, spoken = (
Expand All @@ -70,7 +69,3 @@ def load_csv():
if c.spoken:
command_list[c.spoken] = c.name
ctx.lists["self.emacs_command"] = command_list


# TODO: register on change to file!
app.register("ready", load_csv)
4 changes: 2 additions & 2 deletions apps/firefox/firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
apps.firefox = "app.name: firefox-esr"
apps.firefox = "app.name: LibreWolf"
apps.firefox = "app.name: waterfox"
apps.firefox = """
apps.firefox = r"""
os: windows
and app.name: Firefox
os: windows
and app.exe: firefox.exe
and app.exe: /^firefox\.exe$/i
"""
apps.firefox = """
os: mac
Expand Down
26 changes: 0 additions & 26 deletions apps/git/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,6 @@
mod.list("git_command", desc="Git commands.")
mod.list("git_argument", desc="Command-line git options and arguments.")

dirpath = Path(__file__).parent
arguments_csv_path = str(dirpath / "git_arguments.csv")
commands_csv_path = str(dirpath / "git_commands.csv")


def make_list(path):
with resource.open(path, "r") as f:
rows = list(csv.reader(f))
mapping = {}
# ignore header row
for row in rows[1:]:
if len(row) == 0:
continue
if len(row) == 1:
row = row[0], row[0]
if len(row) > 2:
print("{path!r}: More than two values in row: {row}. Ignoring the extras.")
output, spoken_form = row[:2]
spoken_form = spoken_form.strip()
mapping[spoken_form] = output
return mapping


ctx.lists["self.git_argument"] = make_list(arguments_csv_path)
ctx.lists["self.git_command"] = make_list(commands_csv_path)


@mod.capture(rule="{user.git_argument}+")
def git_arguments(m) -> str:
Expand Down
69 changes: 69 additions & 0 deletions apps/git/git_argument.talon-list
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
list: user.git_argument
-
abort: --abort
all: --all
allow empty: --allow-empty
amend: --amend
cached: --cached
cashed: --cached
color words: --color-words
colour words: --color-words
continue: --continue
copy: --copy
create: --create
delete: --delete
detach: --detach
dir diff: --dir-diff
directory diff: --dir-diff
dry run: --dry-run
edit: --edit
fast forward only: --ff-only
force: --force
force create: --force-create
force with lease: --force-with-lease
global: --global
global: --global
hard: --hard
ignore case: --ignore-case
include untracked: --include-untracked
interactive: --interactive
keep index: --keep-index
list: --list
local: --local
mixed: --mixed
move: --move
no edit: --no-edit
no keep index: --no-keep-index
no rebase: --no-rebase
no track: --no-track
no verify: --no-verify
orphan: --orphan
patch: --patch
prune: --prune
quiet: --quiet
quit: --quit
rebase: --rebase
remote: --remote
set up stream: --set-upstream
set up stream to: --set-upstream-to
short: --short
short stat: --shortstat
skip: --skip
soft: --soft
staged: --staged
stat: --stat
system: --system
track: --track
update: --update
verbose: --verbose
branch: -b
combined: -c
deep: -d
very verbose: -vv
HEAD
main
master
origin
upstream
origin main: origin/main
origin master: origin/master
Loading

0 comments on commit 816e82b

Please sign in to comment.