readme:说明更新。
This commit is contained in:
parent
f608e091ee
commit
1122154e32
@ -1,5 +1,7 @@
|
|||||||
# 简介
|
# 简介
|
||||||
|
|
||||||
在控制台程序中,可以补全文件路径。
|
在控制台程序中,读取用户输入的时候,实现`tab`补全文件路径或者在输入时有补全提示(显示首个匹配项)。
|
||||||
|
|
||||||
|
`tab`键补全仅命中唯一项时可以直接补全,所以需要配合补全提示,两者配合能达到一个基本够用的状态(本项目达到此目标即结束,不开发更复杂的补全和提示)。
|
||||||
|
|
||||||
本项目修改自 [https://github.com/DieTime/cli-autocomplete](https://github.com/DieTime/cli-autocomplete) 。
|
本项目修改自 [https://github.com/DieTime/cli-autocomplete](https://github.com/DieTime/cli-autocomplete) 。
|
@ -274,7 +274,7 @@ char* readline()
|
|||||||
// Print current buffer
|
// Print current buffer
|
||||||
color_print(buffer, DEFAULT_MAIN_COLOR);
|
color_print(buffer, DEFAULT_MAIN_COLOR);
|
||||||
|
|
||||||
// Move cursor to buffer end
|
// Move cursor
|
||||||
int cur_pos{};
|
int cur_pos{};
|
||||||
for (int i = 0; i < buf.size() && i < wo; ++i) {
|
for (int i = 0; i < buf.size() && i < wo; ++i) {
|
||||||
cur_pos += static_cast<int>(buf[i].size());
|
cur_pos += static_cast<int>(buf[i].size());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user