diff --git a/builtins/src/main/java/org/jline/builtins/Nano.java b/builtins/src/main/java/org/jline/builtins/Nano.java index b6484fdc9..a4bbc0553 100644 --- a/builtins/src/main/java/org/jline/builtins/Nano.java +++ b/builtins/src/main/java/org/jline/builtins/Nano.java @@ -2898,8 +2898,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;