This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
ACTUAL: previous commit messages can be accessed by clicking at a button and selecting a message in a separate dialog. This isn't very keyboard-friendly. EXPECTED: support code completion for previous commit messages in the commit message window. Show the last 7 or 10 messages (ordered by the most recent one) and also a "more messages..." entry which opens the old dialog (for the people who liked that) For example: * My most recent message 3 * My recent message 2 * My old message 1 * More previous messages... Trim the message within the CC entry to f.e. 100 chars and while an entry is selected/hovered show the full message in a tooltip/popup window (including linebreaks). This is because several previous commit messages may only differ by their content at line > 1. USECASE: the commit dialog has been opened by an action/shortcut, the commit message dialog has the focus, the user can instantly press CTRL-SPACE to regain the previous commit See the screenshot for the current state in NB 7.4
Created attachment 142518 [details] Patch draft for module git
Created attachment 142519 [details] Patch draft for module versioning.util
Created attachment 142520 [details] Patch draft in action @Ondrej: Here some patch draft to implement this feature. I will continue working on it. Or is it too late for NB8.0? Nevertheless: * What would be the best way to provide input from the dialog context to the completionprovider? In the patch I am "misusing" JEditorPane.putClientProperty
Some more questions: * I guess it would be beneficial to introduce a new mime-type like "text/vcs-commitmsg". But I never did such thing before... * Why is there a special UndoRedoManager used? Doesn't the widget provide a standard implementation? * The completionprovider has to be moved into versioning.util too, so that SVN/HG and CVS can participate too...
> I will continue working on it. Or is it too late for NB8.0? Unfortunately, because we are already feature-frozen for NB 8.0, it will have to wait for the next release. > What would be the best way to provide input from the dialog context to the completionprovider? In the patch I am "misusing" JEditorPane.putClientProperty seems git commit window just extracts recent messages from preferences, see return getRecentCommitMessages(getPreferences()) in GitCommitParameters. So you could turn it into a call to a singleton class, e.g. VCSCommitMessages.getInstance().getRecentMessages(Preferences pref); However you would still need to keep a clientProperty saying what version control system this text component marks. But at least you would not have to keep all messages in memory. Instead just put JEditorPane.putClientProperty(GitModuleConfig.class) and then acquire the pref on demand using NbPreferences.forModule(GitModuleConfig.class). But as i dig deeper into the code it looks the messages are kept in mem even now, so i guess any optimization is pointless. If you want to get rid of the client property completely then i guess you have to register every editor component in a singleton git registry class upon opening the dialog and unregister it upon its close. Then you can query it directly with a call similar to: CommitMessageRegistry.getInstance().getRecentMessages(JTextComponent comp); > I guess it would be beneficial to introduce a new mime-type like "text/vcs-commitmsg". But I never did such thing before... Nor have i. But i agree it may require a separate mime-type. With your implementation i am not sure if this Completion provider does not clash with other providers for text/plain mime types and does not show for example in the standard editor for plain text files. > Why is there a special UndoRedoManager used? Doesn't the widget provide a standard implementation? I think because the default behavior undos/redos just one character at the time, this special UndoManager should work on words also. > The completionprovider has to be moved into versioning.util too, so that SVN/HG and CVS can participate too... Sure, it should be, Looks promising, i have not inspected it in detail so don't know how your change deals with line/word wrapping now (normal editor does not wrap by default, right?) or undo/redo now, but i guess you can fix any problems we find in the process later. Just one note: replace JEditorPane in method signatures with JTextComponent (in versioning,util) so it does not break any implementors.
(In reply to Ondrej Vrabec from comment #5) > > I will continue working on it. Or is it too late for NB8.0? > Unfortunately, because we are already feature-frozen for NB 8.0, it will > have to wait for the next release. Thanks Ondrej for the feedback. I will provide new patches within the next week with your proposals included - i hope so.
let's look at this next release, i'll add my hand.