Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Wagenknecht2016-10-11 21:25:13 +0000
committerGunnar Wagenknecht2016-10-12 12:33:57 +0000
commit46fe26f4f0572ceea2ae4904736fd0d93cb6b95e (patch)
treea9aab61bb71de12f748a2cd3d6bc4460f36d39fb
parent91bb4c3b6bff98f0a8a84c7ec30c46907ceecc27 (diff)
downloadegit-46fe26f4f0572ceea2ae4904736fd0d93cb6b95e.tar.gz
egit-46fe26f4f0572ceea2ae4904736fd0d93cb6b95e.tar.xz
egit-46fe26f4f0572ceea2ae4904736fd0d93cb6b95e.zip
Give focus to commit message when auto-staging is enabled
Bug: 505742 Change-Id: I71a2e7536abde470e4f56053dcc3e7f98e0a3770 Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
index b92e29c51..9356053da 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
@@ -3869,13 +3869,19 @@ public class StagingView extends ViewPart implements IShowInSource {
@Override
public void setFocus() {
Tree tree = unstagedViewer.getTree();
- if (tree.getItemCount() > 0) {
+ if (tree.getItemCount() > 0 && !isAutoStageOnCommitEnabled()) {
unstagedViewer.getControl().setFocus();
return;
}
commitMessageText.setFocus();
}
+ private boolean isAutoStageOnCommitEnabled() {
+ IPreferenceStore uiPreferences = Activator.getDefault()
+ .getPreferenceStore();
+ return uiPreferences.getBoolean(UIPreferences.AUTO_STAGE_ON_COMMIT);
+ }
+
@Override
public void dispose() {
super.dispose();

Back to the top