git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Birger Skogeng PedersenNext: Birger Skogeng Pedersen
Message 8 of 22 in “git-gui: automatically move focus to staged file before typing commit message?”
  1. Birger Skogeng PedersenSep 14, 2019
  2. Pratyush YadavSep 14, 2019
  3. Johannes SixtSep 14, 2019
  4. Pratyush YadavSep 14, 2019
  5. Birger Skogeng PedersenSep 15, 2019
  6. Pratyush YadavSep 16, 2019
  7. Birger Skogeng PedersenSep 26, 2019
  8. Pratyush YadavSep 26, 2019
  9. Birger Skogeng PedersenSep 26, 2019
  10. Birger Skogeng PedersenOct 7, 2019
  11. 1/2 git-gui: implement proc select_path_in_widgetBirger Skogeng Pedersen, Oct 7, 2019
  12. 2/2 git-gui: select staged on ui_comm focusBirger Skogeng Pedersen, Oct 7, 2019
  13. Pratyush YadavOct 16, 2019
  14. Pratyush YadavOct 13, 2019
  15. Birger Skogeng PedersenOct 15, 2019
  16. Pratyush YadavOct 16, 2019
  17. Birger Skogeng PedersenOct 17, 2019
  18. Johannes SixtOct 17, 2019
  19. Birger Skogeng PedersenOct 17, 2019
  20. Pratyush YadavOct 17, 2019
  21. Pratyush YadavOct 8, 2019
  22. Birger Skogeng PedersenOct 8, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.