Add command to temporarily suppress the autosuggestion feature

Autosuggestion will be automatically re-enabled next time a character is
inserted. An alternative implementation would require another command to
explicitly re-enable it.

Signed-off-by: Ian Munsie <darkstarsword@gmail.com>
This commit is contained in:
Ian Munsie 2012-06-27 18:37:48 +10:00 committed by ridiculousfish
parent 2b24eab26a
commit c8f86d94c9
3 changed files with 12 additions and 3 deletions

View file

@ -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,
}
;

View file

@ -49,6 +49,7 @@ enum
R_REPAINT,
R_UP_LINE,
R_DOWN_LINE,
R_SUPPRESS_AUTOSUGGESTION,
}
;

View file

@ -3248,6 +3248,12 @@ 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: