Skip to content

Commit

Permalink
show the matching characters to the count
Browse files Browse the repository at this point in the history
  • Loading branch information
pit-ray committed Apr 4, 2024
1 parent 49b3dd3 commit 7713dc9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
27 changes: 27 additions & 0 deletions src/core/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ SOFTWARE.
#include <cstring>
#include <fstream>
#include <memory>
#include <sstream>

#include "autocmd.hpp"

Expand Down Expand Up @@ -374,6 +375,32 @@ namespace vind
if(!ihub.pull_input(input, count)) {
continue ;
}

auto solver = ihub.get_solver() ;
for(const auto& matcher : solver->get_trigger_matchers()) {
if(matcher->is_matching()) {
auto hist_size = matcher->history_size() ;
if(hist_size == 0) {
break ;
}
auto cmd = matcher->get_command() ;
std::stringstream ss ;
for(
auto itr = cmd.begin() ;
itr < (cmd.begin() + hist_size) ;
itr ++) {
for(auto& key : **itr) {
auto uni = core::keycode_to_unicode(key, **itr) ;
if(!uni.empty()) {
ss << uni ;
}
}
}
std::cout << ss.str() << std::endl ;
break ;
}
}

handle_system_call(input->execute(count)) ;

// correct the state to avoid cases that a virtual key
Expand Down
2 changes: 1 addition & 1 deletion src/core/inputhub.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace vind
public:
static InputHub& get_instance() ;

std::shared_ptr<MapSolver> get_solver(Mode mode) ;
std::shared_ptr<MapSolver> get_solver(Mode mode=get_global_mode()) ;

/*
* Emulate text input and retrieve input at the appropriate time.
Expand Down
2 changes: 1 addition & 1 deletion src/core/version.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _VERSION_HPP
#define _VERSION_HPP

#define WIN_VIND_VERSION "5.11.3.0"
#define WIN_VIND_VERSION "5.11.3.1"

#endif

0 comments on commit 7713dc9

Please sign in to comment.