From 0acde7a14c1fb7988f508ef59b17e1236671c5d7 Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Thu, 27 Jun 2024 23:41:00 -0400 Subject: [PATCH] no size_t --- include/candidate_window.hpp | 5 ++--- preview/preview.mm | 2 +- src/webview_candidate_window.mm | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/candidate_window.hpp b/include/candidate_window.hpp index d2239af..e64fe98 100644 --- a/include/candidate_window.hpp +++ b/include/candidate_window.hpp @@ -115,8 +115,7 @@ class CandidateWindow { ask_actions_callback = callback; } - void - set_action_callback(std::function callback) { + void set_action_callback(std::function callback) { action_callback = callback; } @@ -127,7 +126,7 @@ class CandidateWindow { std::function page_callback = [](bool) {}; std::function scroll_callback = [](int, int) {}; std::function ask_actions_callback = [](int) {}; - std::function action_callback = [](int, int) {}; + std::function action_callback = [](int, int) {}; std::string cursor_text_ = ""; std::string highlight_mark_text_ = ""; bool pageable_ = false; diff --git a/preview/preview.mm b/preview/preview.mm index 8722e16..28844ff 100644 --- a/preview/preview.mm +++ b/preview/preview.mm @@ -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([&] { diff --git a/src/webview_candidate_window.mm b/src/webview_candidate_window.mm index 61d70fe..1eb0f70 100644 --- a/src/webview_candidate_window.mm +++ b/src/webview_candidate_window.mm @@ -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(); });