Skip to content

Commit

Permalink
Merge branch 'master' into indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Oct 11, 2019
2 parents f669f8b + 95b6a65 commit d88c1c7
Show file tree
Hide file tree
Showing 8 changed files with 1,441 additions and 210 deletions.
11 changes: 6 additions & 5 deletions builtins/src/main/java/org/jline/builtins/Nano.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ void computeAllOffsets() {
}
}

LinkedList<Integer> computeOffsets(String text) {
LinkedList<Integer> computeOffsets(String line) {
String text = new AttributedStringBuilder().tabs(tabs).append(line).toString();
int width = size.getColumns() - (printLineNumbers ? 8 : 0);
LinkedList<Integer> offsets = new LinkedList<>();
offsets.add(0);
Expand Down Expand Up @@ -661,7 +662,7 @@ private void cursorDown(int lines) {
column = Math.min(wantedColumn, next - offsetInLine);
}
}
moveToChar(column);
moveToChar(offsetInLine + column);
}

private void cursorUp(int lines) {
Expand Down Expand Up @@ -690,7 +691,7 @@ private void cursorUp(int lines) {
}
}
}
moveToChar(column);
moveToChar(offsetInLine + column);
}

void ensureCursorVisible() {
Expand Down Expand Up @@ -2898,8 +2899,8 @@ void searchAndReplace() {
found = buffer.nextSearch();
if (found) {
int[] re = buffer.highlightStart();
int col = searchBackwards ? buffer.getLine(re[0]).length() - re[1] : re[1];
int match = re[0]*100000 + col;
int col = searchBackwards ? buffer.length(buffer.getLine(re[0])) - re[1] : re[1];
int match = re[0]*10000 + col;
if (matches.contains(match)) {
found = false;
break;
Expand Down

0 comments on commit d88c1c7

Please sign in to comment.