Skip to content

Commit 68fc613

Browse files
authored
Merge branch 'fcitx:master' into master
2 parents 00bb524 + 7e9f570 commit 68fc613

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include(ECMSetupVersion)
1010
include(ECMUninstallTarget)
1111

1212
find_package(Gettext REQUIRED)
13-
find_package(Fcitx5Core 5.1.7 REQUIRED)
13+
find_package(Fcitx5Core 5.1.9 REQUIRED)
1414
find_package(Fcitx5Module REQUIRED COMPONENTS Notifications)
1515
find_package(PkgConfig REQUIRED)
1616

src/rimecandidate.cpp

+6-12
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@ RimeCandidateWord::RimeCandidateWord(RimeEngine *engine,
1919
const RimeCandidate &candidate, KeySym sym,
2020
int idx)
2121
: CandidateWord(), engine_(engine), sym_(sym), idx_(idx) {
22-
Text text;
23-
text.append(std::string(candidate.text));
24-
if (candidate.comment && strlen(candidate.comment)) {
25-
text.append(" ");
26-
text.append(std::string(candidate.comment));
22+
setText(Text{candidate.text});
23+
if (candidate.comment && candidate.comment[0]) {
24+
setComment(Text{candidate.comment});
2725
}
28-
setText(text);
2926
}
3027

3128
void RimeCandidateWord::select(InputContext *inputContext) const {
@@ -45,13 +42,10 @@ RimeGlobalCandidateWord::RimeGlobalCandidateWord(RimeEngine *engine,
4542
const RimeCandidate &candidate,
4643
int idx)
4744
: CandidateWord(), engine_(engine), idx_(idx) {
48-
Text text;
49-
text.append(std::string(candidate.text));
50-
if (candidate.comment && strlen(candidate.comment)) {
51-
text.append(" ");
52-
text.append(std::string(candidate.comment));
45+
setText(Text{candidate.text});
46+
if (candidate.comment && candidate.comment[0]) {
47+
setComment(Text{candidate.comment});
5348
}
54-
setText(text);
5549
}
5650

5751
void RimeGlobalCandidateWord::select(InputContext *inputContext) const {

src/rimeengine.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ FCITX_CONFIGURATION(
5656
isAndroid() ? PreeditMode::No : PreeditMode::ComposingText};
5757
Option<SharedStatePolicy> sharedStatePolicy{
5858
this, "InputState", _("Shared Input State"), SharedStatePolicy::All};
59+
// On Linux only cursor position is available so this pins candidate window
60+
// while typing. On macOS any position within embedded preedit is available
61+
// so this is unnecessary. On Android there is no candidate window yet.
5962
Option<bool> preeditCursorPositionAtBeginning{
6063
this, "PreeditCursorPositionAtBeginning",
6164
_("Fix embedded preedit cursor at the beginning of the preedit"),
62-
!isAndroid()};
65+
!isAndroid() && !isApple()};
6366
Option<bool> commitWhenDeactivate{
6467
this, "Commit when deactivate",
6568
_("Commit current text when deactivating"), true};

0 commit comments

Comments
 (0)