Update commit message in commit pannel on panel open

Answered

I need to populate commit message field automatically each time the commit side panel is open.
In commit dialog it is done with CommitMessageProvider.
It would provide the message I want one time, and then nothing.
How to make the message populate on each panel open?

0
3 comments
Avatar
Permanently deleted user

By "commit side panel" you mean "Commit" tool window, right?

 

Could you please describe your use-case? What parts of commit message should be updated on tool window open? (probably it would be sufficient to only update commit message when "changes checked for commit" are changed?)

Also - what if "Commit" tool window is not hidden, but just unfocused (focus is in the editor) - should the commit message be updated when not hidden "Commit" tool window receives focus as well?

 

0

Yes to "By "commit side panel" you mean "Commit" tool window, right?"
I am loading commit message template, I would like to update whole message on tool window open.
I want that because I have this functionality on Commit dialog - and it seems to be comfortable.

"Also - what if "Commit" tool window is not hidden, but just unfocused (focus is in the editor)" good question - I think no

Right now I think the easiest solution would be to add "refresh template" button in this tool window.

Still, would be nice to get the event on tool window open to refresh

Konstantin Kolosovsky  - Thanks, good questions

0
Avatar
Permanently deleted user

Currently there is no commit-related API for this event.

 

But if talking about other options (like "refresh template" button), you could subscribe to com.intellij.openapi.wm.ex.ToolWindowManagerListener#TOPIC and override ToolWindowManagerListener#toolWindowShown(ToolWindow) with required logic.

0

Please sign in to leave a comment.