Skip to content

Commit

Permalink
GotoLine allow only line
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmanusta committed Aug 11, 2018
1 parent 22b8009 commit 48610ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/kodedu/component/DialogBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public final class DialogBuilder extends TextDialog {

public final static String FILE_NAME_REGEX = ".*\\S.*";
public final static String FOLDER_NAME_REGEX = ".*\\S.*";
public final static String LINE_COLUMN_REGEX = "\\d.*:\\d.*";
public final static String LINE_COLUMN_REGEX = "\\d+:\\d+|\\d+";

public DialogBuilder(String content, String title) {
super(content, title);
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/com/kodedu/component/EditorPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,17 @@ public void initializeEditorContextMenus() {

private void jumpLine(String lineColumn) {
String[] split = lineColumn.split(":");
int line = Integer.parseInt(split[0]);
int column = Integer.parseInt(split[1]);
int line = 0, column = 0;

try {
line = Integer.parseInt(split[0]);
} catch (Exception e) {
}

try {
column = Integer.parseInt(split[1]);
} catch (Exception e) {
}

webEngine().executeScript(String.format("gotoLine(%d,%d)", line, column));
}
Expand Down

0 comments on commit 48610ed

Please sign in to comment.