Skip to content

Commit

Permalink
fix unrepetable problem when having multiple triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
pit-ray committed Nov 6, 2023
1 parent 59bed78 commit 6c0e7e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/inputhub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ namespace vind

auto solver = get_solver(mode) ;
if(parse_count && !solver->is_matching_any()) {
if(!pimpl->count_.empty() && pimpl->count_.back() == ';') {
pimpl->count_.clear() ; // Erase previous counts.
}

// parses the sequence of head counts as the string
// and converts them into a number.
auto new_count = extract_numbers(
Expand All @@ -156,8 +160,8 @@ namespace vind
}

if(!pimpl->count_.empty()) {
pimpl->count_ += ';' ; // Final symbol of counts
count = util::extract_num<std::uint16_t>(pimpl->count_) ;
pimpl->count_.clear() ;
}
else {
count = 1 ;
Expand Down

0 comments on commit 6c0e7e3

Please sign in to comment.