From f364c00a406254bb3fe683972e802ea8bb0b9869 Mon Sep 17 00:00:00 2001 From: mattirn Date: Sun, 20 Sep 2020 09:05:13 +0200 Subject: [PATCH] Autosuggestion history: fixed search command regex pattern, #570 --- .../src/main/java/org/jline/reader/impl/LineReaderImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java b/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java index a5604d187..55c1e133f 100644 --- a/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java +++ b/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java @@ -3962,8 +3962,8 @@ private String matchPreviousCommand(String buffer) { StringBuilder sb = new StringBuilder(); char prev = '0'; for (char c: buffer.toCharArray()) { - if ((c == '(' || c == ')' || c == '[' || c == ']' || c == '{' || c == '}' || c == '^' || c == '*' || c == '\\') - && prev != '\\' ) { + if (c == '(' || c == ')' || c == '[' || c == ']' || c == '{' || c == '}' || c == '^' || c == '*' + || c == '$' || c == '.' || c == '?' || (c == '\\' && prev != '\\')) { sb.append('\\'); } sb.append(c);