From 20076f29a50035d5ab80841d28f83176e213130b Mon Sep 17 00:00:00 2001 From: mattirn Date: Fri, 4 Oct 2019 08:57:25 +0200 Subject: [PATCH] nano: fixed bug in 'search and replace' --- builtins/src/main/java/org/jline/builtins/Nano.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;