Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2016-04-25 11:32:58 -0400
committerMatthias Sohn2016-05-04 18:13:59 -0400
commitbdcf376f7ca170aeba27635ac56862f65e7a4799 (patch)
tree325fb52a11068381c204f9051678ecb494f467de
parentc379e1776b003a8220aaf86d9f19923afea1e854 (diff)
downloadegit-bdcf376f7ca170aeba27635ac56862f65e7a4799.tar.gz
egit-bdcf376f7ca170aeba27635ac56862f65e7a4799.tar.xz
egit-bdcf376f7ca170aeba27635ac56862f65e7a4799.zip
Fix wrong cursor position while editing URIs
When manually editing the URI of a remote, the automatic synchronization of the URI and the remaining fields of the dialog (host, protocol, repo etc.) leads to a wrong cursor position after each character being typed by the user. We avoid this by checking if the update of the URI is a no-op. This fix applies for both the remote configuration dialog as well as the clone wizard since they share the page with the implementation. Bug: 492374 Change-Id: I7052cc822f22238fb491aa66454ad10cf9986c32 Signed-off-by: Michael Keppler <michael.keppler@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
index 7fa6280de..237e70d75 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
@@ -733,7 +733,13 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
eventDepth++;
if (eventDepth == 1) {
uri = u;
- uriText.setText(uri.toString());
+ String oldUriText = uriText.getText();
+ String newUriText = uri.toString();
+ // avoid moving the cursor to the first position if there are no
+ // changes by this automatic update
+ if (!oldUriText.equals(newUriText)) {
+ uriText.setText(newUriText);
+ }
checkPage();
}
} finally {

Back to the top