mirror of
https://github.com/fcitx5-android/fcitx5-android.git
synced 2026-08-02 04:44:35 +08:00
Adopt fcitx5 CandidateWord::spaceBetweenComment API
This commit is contained in:
parent
a99c9c1dc9
commit
5d149c40a6
@ -87,7 +87,7 @@ public:
|
||||
auto &candidate = bulk->candidateFromAll(i);
|
||||
// maybe unnecessary; I don't see anywhere using `CandidateWord::setPlaceHolder`
|
||||
// if (candidate.isPlaceHolder()) continue;
|
||||
candidates.emplace_back(filterString(candidate.textWithComment("")));
|
||||
candidates.emplace_back(filterCandidate(candidate));
|
||||
} catch (const std::invalid_argument &e) {
|
||||
size = static_cast<int>(candidates.size());
|
||||
break;
|
||||
@ -96,7 +96,7 @@ public:
|
||||
} else {
|
||||
size = list->size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
candidates.emplace_back(filterString(list->candidate(i).textWithComment("")));
|
||||
candidates.emplace_back(filterCandidate(list->candidate(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -178,7 +178,7 @@ public:
|
||||
for (int i = offset; i < end; i++) {
|
||||
try {
|
||||
auto &candidate = bulk->candidateFromAll(i);
|
||||
candidates.emplace_back(filterString(candidate.textWithComment()));
|
||||
candidates.emplace_back(filterCandidate(candidate));
|
||||
} catch (const std::invalid_argument &e) {
|
||||
break;
|
||||
}
|
||||
@ -186,7 +186,7 @@ public:
|
||||
} else {
|
||||
const int end = std::min(list->size(), last);
|
||||
for (int i = offset; i < end; i++) {
|
||||
candidates.emplace_back(filterString(list->candidate(i).textWithComment()));
|
||||
candidates.emplace_back(filterCandidate(list->candidate(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -275,6 +275,11 @@ private:
|
||||
inline std::string filterString(const Text &orig) {
|
||||
return filterText(orig).toString();
|
||||
}
|
||||
|
||||
inline std::string filterCandidate(const CandidateWord &candidate) {
|
||||
const std::string separator = candidate.spaceBetweenComment() ? " " : "";
|
||||
return filterString(candidate.textWithComment(separator));
|
||||
}
|
||||
};
|
||||
|
||||
AndroidFrontend::AndroidFrontend(Instance *instance)
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 6a17c501c4e56774a8fd18a5ce94a9c283d766a3
|
||||
Subproject commit 5485990ec71fd25026539722bf417a2d4ff1bb69
|
||||
@ -1 +1 @@
|
||||
Subproject commit 57ad871cf5a04fb4120f6f3618affa03ea3c994b
|
||||
Subproject commit 89c3d18086cf9891a4062a7f15ead63eaab12e7d
|
||||
@ -1 +1 @@
|
||||
Subproject commit e1e65fa39ed71be99c0a3199ac782112b2145d46
|
||||
Subproject commit e13df762aea9bc7627bf6f3960c6ecb65115225d
|
||||
Loading…
x
Reference in New Issue
Block a user