From 8d3bbdf2a27308f7f912428e99314ffcad041ced Mon Sep 17 00:00:00 2001 From: pit-ray Date: Fri, 10 Nov 2023 17:11:03 +0900 Subject: [PATCH 1/3] add placeholder --- src/bind/mode/command_mode.cpp | 8 ++++++++ src/core/version.hpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bind/mode/command_mode.cpp b/src/bind/mode/command_mode.cpp index b7e56aec..936d612e 100644 --- a/src/bind/mode/command_mode.cpp +++ b/src/bind/mode/command_mode.cpp @@ -183,6 +183,10 @@ namespace vind return result ; } + void complement_command() { + + } + void write_as_printable(const core::CmdUnit::SPtr& input) { // Aggregate the printable keys into this vector from input and outputs. std::vector printables ; @@ -285,6 +289,10 @@ namespace vind pimpl->forward_history() ; continue ; } + if(input->is_containing(KEYCODE_TAB)) { + pimpl->complement_command() ; + continue ; + } if(input->is_containing(KEYCODE_ENTER)) { result = pimpl->decide() ; break_flag = true ; diff --git a/src/core/version.hpp b/src/core/version.hpp index 08dd0afc..0fd51126 100644 --- a/src/core/version.hpp +++ b/src/core/version.hpp @@ -1,6 +1,6 @@ #ifndef _VERSION_HPP #define _VERSION_HPP -#define WIN_VIND_VERSION "5.5.2.0" +#define WIN_VIND_VERSION "5.6.0.0" #endif From bdd3f588881b3eac1f18cfce9e1c0c3efdc2aa89 Mon Sep 17 00:00:00 2001 From: pit-ray Date: Fri, 5 Jan 2024 05:12:27 +0900 Subject: [PATCH 2/3] update documents --- docs/cheat_sheet/functions/index.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/cheat_sheet/functions/index.md b/docs/cheat_sheet/functions/index.md index 015ea6b7..40038647 100644 --- a/docs/cheat_sheet/functions/index.md +++ b/docs/cheat_sheet/functions/index.md @@ -9,7 +9,19 @@ disable_anchors: true ## Mode ### **``** -Enter the command mode. Generally, this command is called with `:`. In the command mode, the typed characters are displayed on the virtual command line, the command can be executed with the `` key, and you can delete characters with ``. You can also use the `` and `` keys to move thr class="dash"ough the executed history. +Enter the command mode, which is generally called with `:`. +In the command mode, the typed characters are displayed on the virtual command line. +You can operate the virtual command line as shown in the following table. + +|**Key**|**Operation**| +|:---:|:---:| +|``|Execute the current command| +|``|Delete characters| +|``|Backward history| +|``|Forward history| +|``|Complete commands| + +

From 2673c616ece62744b5c226d60a36481f8c68efc9 Mon Sep 17 00:00:00 2001 From: pit-ray Date: Fri, 5 Jan 2024 05:19:29 +0900 Subject: [PATCH 3/3] fix compile error --- src/bind/mode/command_mode.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/bind/mode/command_mode.cpp b/src/bind/mode/command_mode.cpp index 8049ebd2..e485d834 100644 --- a/src/bind/mode/command_mode.cpp +++ b/src/bind/mode/command_mode.cpp @@ -209,7 +209,7 @@ namespace vind } } - std::set candidates_set ; + std::set candidate_set ; auto matchers = solver->get_trigger_matchers() ; for(auto matcher : matchers) { if(!matcher->is_rejected()) { @@ -243,10 +243,10 @@ namespace vind cmd_str += s ; } - if(candidate_set.find(cmd_str) != candidate_set.end()) { // Avoid the duplicated candidates. + if(candidate_set.find(cmd_str) == candidate_set.end()) { // Avoid the duplicated candidates. candidates_.push_back(std::move(cmd_no_args)) ; print_candidates_.push_back(std::move(print_cmd_no_args)) ; - candidates_str.push_back(std::move(cmd_str)) ; + candidate_set.insert(std::move(cmd_str)) ; } } } @@ -254,7 +254,7 @@ namespace vind // Show the candidates in the virtual command line. if(!candidates_.empty()) { std::stringstream ss ; - for(const auto& s : candidates_str) { + for(const auto& s : candidate_set) { ss << ":" << s << " " ; } opt::VCmdLine::print(opt::StaticMessage(ss.str())) ; @@ -393,7 +393,10 @@ namespace vind break_flag = true ; break ; } - pimpl->clear_candidates() ; + + if(!pimpl->candidates_.empty()) { + pimpl->clear_candidates() ; + } pimpl->write_as_printable(input) ; } while(!ihub.is_empty_queue()) ;