Skip to content

Commit

Permalink
Autosuggestion history: fixed search command regex pattern, #570
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Sep 20, 2020
1 parent f6c1246 commit f364c00
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f364c00

Please sign in to comment.