hchunhui / librime-lua

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

修改 context.input 要注意 ,會觸發 update_notifier #264

Open shewer opened 1 year ago

shewer commented 1 year ago

只要是 更動 context.input 就會觸發 update_notifier --> Engine::Compose() 最好是在 確認更動時才 變更,或是須要 compose() 刷新 接着處理時 可在 librime/src/context.cc 找有呼叫 "updatenotifier(this)" 的member function

   local input = context.input
   input = ...
   .....
   if ... then 
       input = ....
       conetxt.input = input  -- 觸發 Compose()
   elseif ...
      context:input_push( "x") -- 觸發 Compose()
   else 
    ...
   end
---------- 多次修改新造成多次觸發
   context.input = context.input:low()
   context.input = context.input .. "-"
   context.input = context.input:match(' ...')
   context:push_input( ...)
----------
    local input = context.input
    input = input .. "-"
    input = input:match('...')
    input = input .. "..."
    context.input = input
groverlynn commented 9 months ago

相当于你敲了键盘,但希望输入法没反应?