mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
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:
parent
2b24eab26a
commit
c8f86d94c9
3 changed files with 12 additions and 3 deletions
|
@ -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,
|
||||
}
|
||||
;
|
||||
|
||||
|
|
1
input.h
1
input.h
|
@ -49,6 +49,7 @@ enum
|
|||
R_REPAINT,
|
||||
R_UP_LINE,
|
||||
R_DOWN_LINE,
|
||||
R_SUPPRESS_AUTOSUGGESTION,
|
||||
}
|
||||
;
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue