From 2d82d47ac4e91c18375dced41304475d88ee6c00 Mon Sep 17 00:00:00 2001 From: mattirn Date: Wed, 16 Sep 2020 18:20:54 +0200 Subject: [PATCH] Auto suggestion error when type "\_" character, fixes #570 --- reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2334eb036..a5604d187 100644 --- a/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java +++ b/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java @@ -3962,7 +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 == '*') && prev != '\\' ) { + if ((c == '(' || c == ')' || c == '[' || c == ']' || c == '{' || c == '}' || c == '^' || c == '*' || c == '\\') + && prev != '\\' ) { sb.append('\\'); } sb.append(c);