Skip to content
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

Default main view / jump to "Staged/Unstaged changes" #1329

Closed
andree182 opened this issue Apr 17, 2024 · 5 comments
Closed

Default main view / jump to "Staged/Unstaged changes" #1329

andree182 opened this issue Apr 17, 2024 · 5 comments

Comments

@andree182
Copy link

An (via tigrc or bindable command) option to jump to one of the "Staged changes", "Unstaged changes", "HEAD" in the main view would be handy.

@koutcher
Copy link
Collaborator

koutcher commented Apr 17, 2024

There is already a default binding to jump to HEAD (H). There is no binding for Staged changes and Unstaged changes but they are generally located next to HEAD. If you really want a binding, you can add one to your .tigrc taking @ as an example.

@andree182
Copy link
Author

Right. But ATM there's nothing like the 'HEAD' ref for staged/unstaged, or is it? I see e.g. LINE_STAT_UNSTAGED in the code, but can't figure out anything that could be used as ":goto xyz".

Or you mean some hack with that "/^@@"? I don't see how to put anything like that into goto_id()...

@koutcher
Copy link
Collaborator

It's not a hack, :/Unstaged changes will look for lines containing the text Unstaged changes. You can't use goto, it requires a ref argument.

@andree182
Copy link
Author

Cool, that works, as does just simply '/Unstaged changes', any specific reason why use ':/...'?

Last thing, it seems that I'd need something like #1328 , to do the following

:/Unstaged changes ; :enter

but it seems that (if I'm looking at the right code) run_prompt_command() / exec_run_request() doesn't have a way to split the command and/or terminate the search string. E.g. something like:

:/Unstaged changes/ ; :enter

I'm just asking, it's probably just a minor usecase, so if it's not possible, no problem...

@koutcher
Copy link
Collaborator

Copy-paste from @, :/ is the original syntax. It is not possible to bind multiple commands at this time, the keybinding structure only references one request. Making it "multiple" might not be straightforward for the execution part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants