Configure filename completer for edit and write commands
This commit is contained in:
parent
63191f1900
commit
3afbbefd9b
|
@ -144,7 +144,7 @@ std::string prompt(const std::string& text,
|
||||||
{
|
{
|
||||||
if (current_completion == -1)
|
if (current_completion == -1)
|
||||||
{
|
{
|
||||||
completions = completer(result, result.length());
|
completions = completer(result, cursor_pos);
|
||||||
if (completions.candidates.empty())
|
if (completions.candidates.empty())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -359,10 +359,11 @@ std::unordered_map<char, std::function<void (Window& window, int count)>> keymap
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
init_ncurses();
|
init_ncurses();
|
||||||
|
command_manager.register_command(std::vector<std::string>{ "e", "edit" }, edit,
|
||||||
command_manager.register_command(std::vector<std::string>{ "e", "edit" }, edit);
|
PerArgumentCommandCompleter{ complete_filename });
|
||||||
command_manager.register_command(std::vector<std::string>{ "q", "quit" }, quit);
|
command_manager.register_command(std::vector<std::string>{ "q", "quit" }, quit);
|
||||||
command_manager.register_command(std::vector<std::string>{ "w", "write" }, write_buffer);
|
command_manager.register_command(std::vector<std::string>{ "w", "write" }, write_buffer,
|
||||||
|
PerArgumentCommandCompleter{ complete_filename });
|
||||||
command_manager.register_command(std::vector<std::string>{ "b", "buffer" }, show_buffer);
|
command_manager.register_command(std::vector<std::string>{ "b", "buffer" }, show_buffer);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue
Block a user