diff --git a/input.cpp b/input.cpp index f65f1d5a6..d2f8fb346 100644 --- a/input.cpp +++ b/input.cpp @@ -129,7 +129,8 @@ static const wchar_t *name_arr[] = L"end-of-buffer", L"repaint", L"up-line", - L"down-line" + L"down-line", + L"suppress-autosuggestion" } ; @@ -210,7 +211,8 @@ static const wchar_t code_arr[] = R_END_OF_BUFFER, R_REPAINT, R_UP_LINE, - R_DOWN_LINE + R_DOWN_LINE, + R_SUPPRESS_AUTOSUGGESTION, } ; diff --git a/input.h b/input.h index fbb4d7fd7..e62fe2bb6 100644 --- a/input.h +++ b/input.h @@ -49,6 +49,7 @@ enum R_REPAINT, R_UP_LINE, R_DOWN_LINE, + R_SUPPRESS_AUTOSUGGESTION, } ; diff --git a/reader.cpp b/reader.cpp index db8ba2a66..8d5783115 100644 --- a/reader.cpp +++ b/reader.cpp @@ -3247,7 +3247,13 @@ const wchar_t *reader_readline() break; } - + + case R_SUPPRESS_AUTOSUGGESTION: + { + data->suppress_autosuggestion = true; + data->autosuggestion.clear(); + reader_repaint(); + } /* Other, if a normal character, we add it to the command */ default: