rime / librime

Rime Input Method Engine, the core library
https://rime.im
BSD 3-Clause "New" or "Revised" License
3.36k stars 550 forks source link

fix deleting current candidate #906

Closed eagleoflqj closed 3 months ago

eagleoflqj commented 3 months ago

Pull request

Issue tracker

Fixes will automatically close the related issue

Fixes #

Feature

As in practice when both

DeleteCandidate(size_t index)

and

DeleteCandidate(std::optional<size_t> index)

exists, DeleteCandidate({}) is translated to DeleteCandidate(0) at least for clang on macOS. 🌚

Unit test

Manual test

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

lotem commented 3 months ago

I find it clearer to keep DeleteCurrentSelection() and DeleteCandidate(size_t index) separate.