Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete candidate APIs ignore index #899

Closed
2 tasks done
eagleoflqj opened this issue Jun 19, 2024 · 0 comments · Fixed by #900
Closed
2 tasks done

delete candidate APIs ignore index #899

eagleoflqj opened this issue Jun 19, 2024 · 0 comments · Fixed by #900
Labels

Comments

@eagleoflqj
Copy link
Member

Describe the bug

delete_candidate and delete_candidate_on_current_page ignore index and always delete highlighted candidate.

To Reproduce

  1. In luna-pinyin, commit 2 words with the same pinyin and not in dict.
  2. Right click the 2nd one on f5m or long press the 2nd one on f5a.
  3. Forget word.
  4. The 1st word is gone.

Expected behavior

The 2nd word is gone.

Log

I20240619 12:02:23.835766 0x170437000 context.cc:152] Deleting candidate: '苫次
I20240619 12:02:23.835961 0x170437000 memory.cc:127] deleting entry: '善此'.
I20240619 12:02:23.836090 0x170437000 level_db.cc:182] update db entry: shan ci 善此 => c=-1 d=0.99005 t=3

Flavor(please complete the following information):

  • fcitx5-rime (macOS)
  • fcitx5-rime (Android)

Additional context

Candidate info is clearly lost:

librime/src/rime/context.cc

Lines 151 to 154 in a4f24fd

if (auto cand = get_candidate(seg)) {
DLOG(INFO) << "Deleting candidate: '" << cand->text();
delete_notifier_(this);
return true; // CAVEAT: this doesn't mean anything is deleted for sure

Always delete selected:

auto phrase =
As<Phrase>(Candidate::GetGenuineCandidate(ctx->GetSelectedCandidate()));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant