Slight code cleanup in prompt history handling
This commit is contained in:
parent
b83c09509e
commit
1a16590960
|
@ -789,7 +789,6 @@ public:
|
|||
completion);
|
||||
}
|
||||
|
||||
if (not context().history_disabled())
|
||||
history_push(line);
|
||||
context().print_status(DisplayLine{});
|
||||
if (context().has_client())
|
||||
|
@ -806,7 +805,6 @@ public:
|
|||
}
|
||||
else if (key == Key::Escape or key == ctrl('c'))
|
||||
{
|
||||
if (not context().history_disabled())
|
||||
history_push(line);
|
||||
context().print_status(DisplayLine{});
|
||||
if (context().has_client())
|
||||
|
@ -1103,7 +1101,7 @@ private:
|
|||
|
||||
void history_push(StringView entry)
|
||||
{
|
||||
if (entry.empty() or
|
||||
if (entry.empty() or context().history_disabled() or
|
||||
(m_flags & PromptFlags::DropHistoryEntriesWithBlankPrefix and
|
||||
is_horizontal_blank(entry[0_byte])))
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user