From c477dad67e171aecf9fb5b8ce361119bf459ff8f Mon Sep 17 00:00:00 2001 From: taynpg Date: Fri, 28 Mar 2025 12:54:44 +0800 Subject: [PATCH] =?UTF-8?q?add=EF=BC=9A=E6=B7=BB=E5=8A=A0his=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=94=BE=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filecomplete.cpp | 6 ++++++ filecomplete.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/filecomplete.cpp b/filecomplete.cpp index 0f07590..4ed3e9f 100644 --- a/filecomplete.cpp +++ b/filecomplete.cpp @@ -212,6 +212,12 @@ void append_his(const std::string& his) his_pos = history.size(); } +void fc_add_his(const char* his_input) +{ + history.push_back(his_input); + his_pos = history.size(); +} + std::string up_his() { if (history.size() < 1) { diff --git a/filecomplete.h b/filecomplete.h index 56d94dc..f1820c1 100644 --- a/filecomplete.h +++ b/filecomplete.h @@ -78,6 +78,13 @@ void fc_turn_on(); */ void fc_turn_off(); +/** + * @brief 添加输入历史记录。 + * + * @param his_input 输入内容。 + */ +void fc_add_his(const char* his_input); + /** * @brief 恢复默认终端颜色 */