hchunhui / librime-lua

Extending RIME with Lua scripts
BSD 3-Clause "New" or "Revised" License
357 stars 43 forks source link

如何构造一个CommitRecord并将其推入commit_history #374

Closed boomker closed 1 week ago

boomker commented 1 week ago

我有以下代码:

    local commit_history = context.commit_history
    commit_history:push(CommitRecord(cand.type, cand_txt))

但是好像不生效,大佬帮忙看看,谢谢🙏

shewer commented 1 week ago

沒有 CommitRecord() 這個function push 兩個參數 ( stirng, string) -- cand.type, cand.text : 直接替代 CommitRecord(type, text) (composition, string) -- context.composition, context.input , 可以參考 librime CommitRecord::Push()