Skip to content

Commit

Permalink
no size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Jun 28, 2024
1 parent 50e5a33 commit 0acde7a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions include/candidate_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ class CandidateWindow {
ask_actions_callback = callback;
}

void
set_action_callback(std::function<void(size_t index, int id)> callback) {
void set_action_callback(std::function<void(int index, int id)> callback) {
action_callback = callback;
}

Expand All @@ -127,7 +126,7 @@ class CandidateWindow {
std::function<void(bool next)> page_callback = [](bool) {};
std::function<void(int, int)> scroll_callback = [](int, int) {};
std::function<void(int index)> ask_actions_callback = [](int) {};
std::function<void(size_t index, int id)> action_callback = [](int, int) {};
std::function<void(int index, int id)> action_callback = [](int, int) {};
std::string cursor_text_ = "";
std::string highlight_mark_text_ = "";
bool pageable_ = false;
Expand Down
2 changes: 1 addition & 1 deletion preview/preview.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main(int argc, const char *argv[]) {
candidateWindow->set_page_callback([](bool next) {
std::cout << (next ? "next" : "prev") << " page" << std::endl;
});
candidateWindow->set_action_callback([](size_t index, int id) {
candidateWindow->set_action_callback([](int index, int id) {
std::cout << "action " << id << " on " << index << std::endl;
});
auto t = std::thread([&] {
Expand Down
2 changes: 1 addition & 1 deletion src/webview_candidate_window.mm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ NSRect getNearestScreenFrame(double x, double y) {

bind("_askActions", [this](int i) { ask_actions_callback(i); });

bind("_action", [this](size_t i, int id) { action_callback(i, id); });
bind("_action", [this](int i, int id) { action_callback(i, id); });

bind("_onload", [this]() { init_callback(); });

Expand Down

0 comments on commit 0acde7a

Please sign in to comment.