Skip to content

Commit bd2d522

Browse files
committed
expand tab actions
1 parent 15d4fdc commit bd2d522

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

core/windows_and_tabs/tabs.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from talon import Module, actions, app
1+
from talon import Module, actions
22

33
mod = Module()
44

@@ -19,3 +19,34 @@ def tab_close_wrapper():
1919

2020
def tab_duplicate():
2121
"""Duplicates the current tab."""
22+
23+
def tab_search():
24+
"""Searches through the tabs."""
25+
26+
def tab_pin():
27+
"""Pins the current tab."""
28+
29+
def tab_unpin():
30+
"""Unpins the current tab."""
31+
32+
def tab_rename_wrapper(name: str):
33+
"""Applies formatting to tab name prior to passing to overridden tab_rename()"""
34+
if len(name):
35+
name = actions.user.formatted_text(name, actions.user.tab_name_format())
36+
actions.app.tab_rename(name)
37+
38+
def tab_rename(name: str):
39+
"""Renames the current tab."""
40+
41+
def tab_name_format():
42+
"""Formatters for tab names in given app"""
43+
return "ALL_CAPS,DASH_SEPARATED"
44+
45+
def tab_focus_most_recent():
46+
"""Jumps to the most recently viewed tab."""
47+
48+
def tab_move_left():
49+
"""Moves the current tab to the left."""
50+
51+
def tab_move_right():
52+
"""Moves the current tab to the right."""

core/windows_and_tabs/tabs.talon

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@ tag: user.tabs
33
tab (open | new): app.tab_open()
44
tab (last | previous): app.tab_previous()
55
tab next: app.tab_next()
6-
tab close: user.tab_close_wrapper()
76
tab (reopen | restore): app.tab_reopen()
7+
8+
tab close: user.tab_close_wrapper()
89
go tab <number>: user.tab_jump(number)
910
go tab final: user.tab_final()
1011
tab duplicate: user.tab_duplicate()
12+
tab search: user.tab_search()
13+
tab pin: user.tab_pin()
14+
tab unpin: user.tab_unpin()
15+
tab rename [<user.text>]: user.tab_rename_wrapper(text or "")
16+
tab flip: user.tab_focus_most_recent()
17+
tab move left: user.tab_move_left()
18+
tab move right: user.tab_move_right()

0 commit comments

Comments
 (0)