Skip to content

Commit

Permalink
refact: use nvim_feedkeys()
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu authored and black-desk committed Jun 26, 2024
1 parent 7827698 commit 12aa137
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lua/fcitx5-ui/sighdlr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ M.CurrentIM = function(_, name, cname, lan)
end

M.CommitString = function(_, str)
local r, c = unpack(vim.api.nvim_win_get_cursor(0))
vim.schedule(function()
vim.api.nvim_buf_set_text(0, r - 1, c, r - 1, c, { str })
vim.api.nvim_win_set_cursor(0, { r, c + #str })
vim.api.nvim_feedkeys(str, 't', true)
end)
end

Expand Down

0 comments on commit 12aa137

Please sign in to comment.