Re: git-gui: automatically move focus to staged file before typing commit message?
- From
Pratyush Yadav <me@yadavpratyush.com>
- Date
- Sep 26, 2019, 19:30 UTC
- Message-ID
- <20190926193004.jspiirmb4ejxznjo@yadavpratyush.com>
- In-Reply-To
- <CAGr--=+SNO7GuHH-dE_ZnrJDCa8tv8EA5LMrVGwsMTRpxhzEZA@mail.gmail.com>
On 26/09/19 08:33PM, Birger Skogeng Pedersen wrote:
Show 6 quoted lines
> Honestly I'll need some help to get this one implemented. The only > implementation I've got working currently, is to change Alt+4 key bind > to do the following: > - Focus the "Staged Changes" widget (which will select a path in the > list, if it isn't focused already), then > - Focus the "Commit Message" widget
Why are you changing the Alt+4 binding? This means your feature won't work for people who use the mouse to move around in the UI (which I suppose would be a majority).
Did you try binding a script to the FocusIn event of the commit message
buffer? You can do this like:
bind $ui_comm <FocusIn> {your_script}I'm not sure if $ui_comm is the correct widget, but you can experiment a bit by printing something in your_script to find out for sure.
-- Regards, Pratyush Yadav