Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
pit-ray committed Jan 4, 2024
1 parent bdd3f58 commit 2673c61
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/bind/mode/command_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ namespace vind
}
}

std::set<std::string> candidates_set ;
std::set<std::string> candidate_set ;
auto matchers = solver->get_trigger_matchers() ;
for(auto matcher : matchers) {
if(!matcher->is_rejected()) {
Expand Down Expand Up @@ -243,18 +243,18 @@ 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)) ;
}
}
}

// 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())) ;
Expand Down Expand Up @@ -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()) ;

Expand Down

0 comments on commit 2673c61

Please sign in to comment.