From 39ff1d0ff25eccfd028d4dc657f24620f10e16b5 Mon Sep 17 00:00:00 2001 From: Zebra2711 Date: Sun, 22 Feb 2026 15:27:44 +0700 Subject: [PATCH] replace stringutils::startsWith --- src/lotus-engine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lotus-engine.cpp b/src/lotus-engine.cpp index 08bb903..d9cbf15 100644 --- a/src/lotus-engine.cpp +++ b/src/lotus-engine.cpp @@ -324,7 +324,11 @@ namespace fcitx { const Configuration* LotusEngine::getSubConfig(const std::string& path) const { if (path == "custom_keymap") return &customKeymap_; +#if __cplusplus >= 202002L + if (path.starts_with(MacroPrefix)) { +#else if (stringutils::startsWith(path, MacroPrefix)) { +#endif const auto imName = path.substr(strlen(MacroPrefix)); if (auto iter = macroTables_.find(imName); iter != macroTables_.end()) return &iter->second; @@ -360,7 +364,11 @@ namespace fcitx { customKeymap_.load(config, true); safeSaveAsIni(customKeymap_, CustomKeymapFile); refreshEngine(); +#if __cplusplus >= 202002L + } else if (path.starts_with(MacroPrefix)) { +#else } else if (stringutils::startsWith(path, MacroPrefix)) { +#endif const auto imName = path.substr(strlen(MacroPrefix)); if (auto iter = macroTables_.find(imName); iter != macroTables_.end()) { iter->second.load(config, true);