readme:说明更新。

This commit is contained in:
taynpg 2025-01-09 09:31:05 +08:00
parent f608e091ee
commit 1122154e32
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,7 @@
# 简介
在控制台程序中,可以补全文件路径。
在控制台程序中,读取用户输入的时候,实现`tab`补全文件路径或者在输入时有补全提示(显示首个匹配项)。
`tab`键补全仅命中唯一项时可以直接补全,所以需要配合补全提示,两者配合能达到一个基本够用的状态(本项目达到此目标即结束,不开发更复杂的补全和提示)。
本项目修改自 [https://github.com/DieTime/cli-autocomplete](https://github.com/DieTime/cli-autocomplete) 。

View File

@ -274,7 +274,7 @@ char* readline()
// Print current buffer
color_print(buffer, DEFAULT_MAIN_COLOR);
// Move cursor to buffer end
// Move cursor
int cur_pos{};
for (int i = 0; i < buf.size() && i < wo; ++i) {
cur_pos += static_cast<int>(buf[i].size());