history tweak

This commit is contained in:
folkert van heusden 2024-05-07 16:42:37 +02:00
parent 8c8084ec5b
commit 48cd8e2acd
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -182,7 +182,7 @@ std::string console::read_line(const std::string & prompt)
put_string(prompt); put_string(prompt);
put_string(">"); put_string(">");
if (edit_lines_hist.empty() == false) while(edit_lines_hist.size() >= n_edit_lines_hist)
edit_lines_hist.erase(edit_lines_hist.begin()); edit_lines_hist.erase(edit_lines_hist.begin());
while(edit_lines_hist.size() < n_edit_lines_hist) while(edit_lines_hist.size() < n_edit_lines_hist)
@ -267,6 +267,9 @@ std::string console::read_line(const std::string & prompt)
put_string_lf(""); put_string_lf("");
if (line_nr != edit_lines_hist.size() - 1)
edit_lines_hist.push_back(edit_lines_hist.at(line_nr));
return edit_lines_hist.at(line_nr); return edit_lines_hist.at(line_nr);
} }