-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand split and tab actions, and try to unify naming/conventions #1446
base: main
Are you sure you want to change the base?
Conversation
7fc295b
to
0998fee
Compare
As noted in #1447, there is |
9b50b89
to
87f715a
Compare
87f715a
to
1c01b85
Compare
I brought in the tab PR changes here, also significantly expanded the tab actions. For now I've only modified vscode.py to use the new actions just to demo what it would be like, but if/once we agree on naming/conventions all update all of the other apps in community. I had noted in the tab PR that it's confusing that tabs are part of core/windows_and_tabs/ where as splits are part of tags/splits, so I also opted to move tabs to tags/tabs/ as part of this PR, as I think it's easier to find things and navigate. |
One other thing I suspect people will want to change is atm I make the |
4895113
to
4b90253
Compare
actions.user.vscode("workbench.action.maximizeEditor") | ||
|
||
def split_layout_reset(): | ||
actions.user.vscode("workbench.action.evenEditorWidths") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workbench.action.editorLayoutSingle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree with this one. As the action description says, it's meant to resize all splits to the default, which is what workbench.action.evenEditorWidths does. What you're suggesting would be suitable for split_close_all() (and is what it does).
I made an initial review, but it looks pretty good |
fb45da7
to
4cd2d5a
Compare
5e90dc8
to
a8e76d0
Compare
I did just add one other small split update, but I think for the most part the proposed actions/naming/etc is stable, so is good for others to look at and discuss. I'm leaving it as a draft because of still needing to update all of the other apps using tabs/splits once things are agreed upon. |
This commit attempts to unify the naming of splits and tabs, as well as significantly expanding the available functionality. The caveat is that it also deprecates most of the previously defined actions.
8ba0649
to
96e5b9e
Compare
c854d3c
to
03b8cb6
Compare
for more information, see https://pre-commit.ci
03b8cb6
to
8fb360a
Compare
tags/tabs/tabs.talon
Outdated
tab (open | new): app.tab_open() | ||
tab (open | new) named [<user.text>]: user.tab_open_with_name(text or "") | ||
tab (reopen | restore): app.tab_reopen() | ||
tab duplicate: user.tab_clone() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tab clone
spoken from is preferred apparently, cf slack
tags/tabs/tabs.py
Outdated
as vscode, jetbrains, etc.""" | ||
|
||
# Renaming | ||
def tab_rename(name: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def tab_rename(name: str = ""):
tags/tabs/tabs.py
Outdated
@mod.action_class | ||
class TabActions: | ||
# Creation | ||
def tab_open_with_name(name: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def tab_open_with_name(name: str = ""):
class TabActions: | ||
# Creation | ||
def tab_open_with_name(name: str): | ||
"""Opens a tab renamed to the specified""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Opens a new tab and rename it"""
tags/tabs/tabs.talon
Outdated
|
||
# Renaming | ||
tab rename [<user.text>]: user.tab_rename_formatted(text or "") | ||
tab [name] reset: user.tab_reset_name() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user.tab_name_reset()
This expands both the tab and split commands associated actions. In trying to unify the grammar/naming, I ended up deprecating almost everything, which may be a bit controversial.
I haven't applied these new action to all of the contexts that are overriding them because I want to first agree on the naming. I also won't add a comment to the breaking changes file until we decide if/what becomes deprecated.
The background here is that we plan to neovim-talon available as a plugin, and it includes support for significantly more split and tab related functionality than what's currently available in community. Furthermore, I personally use (and I think andreas repo) have more tab-related functoinality. Most of them should be generic and part of community, especially because other apps will benefit.
I've also chosen to use the command "cross" first split navigation, because I know some people use that in vscode first splits already and @saidelike uses it for vim. I've also started using it since working on this and seems fine.