Revert "InlineEdit: Switch to using native jump-to-line addon"
This reverts commit 99d8d3c21f2bcdcc15390964e893f0de5221ef18.
We need to revert the CodeMirror upgrade to 5.11 which was done by
Id02e65 because it broke displaying the file diff for certain files as
reported by issue 3927 [1]. Since this commit relies on the new
CodeMirror version is must be reverted as well.
[1] https://code.google.com/p/gerrit/issues/detail?id=3927
Change-Id: I6b15aa239666348e5c4ac50f4b248ef9a8f00cc5
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/editor/EditScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/editor/EditScreen.java
index 670b5c8..a546c62 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/editor/EditScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/editor/EditScreen.java
@@ -257,7 +257,20 @@
return new Runnable() {
@Override
public void run() {
- cm.execCommand("jumpToLine");
+ String n = Window.prompt(EditConstants.I.gotoLineNumber(), "");
+ if (n != null) {
+ try {
+ int line = Integer.parseInt(n);
+ line--;
+ if (line >= 0) {
+ cm.scrollToLine(line);
+ }
+ } catch (NumberFormatException e) {
+ // ignore non valid numbers
+ // We don't want to popup another ugly dialog just to say
+ // "The number you've provided is invalid, try again"
+ }
+ }
}
};
}
diff --git a/lib/codemirror/cm.defs b/lib/codemirror/cm.defs
index 39c4f09..9677058 100644
--- a/lib/codemirror/cm.defs
+++ b/lib/codemirror/cm.defs
@@ -19,7 +19,6 @@
'edit/trailingspace.js',
'scroll/annotatescrollbar.js',
'scroll/simplescrollbars.js',
- 'search/jump-to-line.js',
'search/matchesonscrollbar.js',
'search/searchcursor.js',
'search/search.js',