Closed hoofcushion closed 1 month ago
vim.keymap.set({"n","x"},"<leader>ae",require("fittencode.api").api.explain_code,{})
Problem:
如此设置一个映射,在 visual mode 下触发,无法获取 range 参数,必须使用 ":Fitten explain_code<cr>"
才能获取
Solution:
在 action 检测到目前处于 visual mode,先回到 normal mode,然后 nvim_buf_get_mark 获取 range ( '<, '>
要在退出 visual mode 后才会更新), 否则直接从 '<, '>
获取 range.
Hi @hoofcushion
Please rebase the code and keep only the main parts that have been changed
@luozhiya Done.
But doc/tags This file is changed, and I have no idea how to recovery it. Would you help to see it?
I enabled Allow edits and access to secrets by maintainers
vim.keymap.set({"n","x"},"<leader>ae",require("fittencode.api").api.explain_code,{})
Problem: 如此设置一个映射,在 visual mode 下触发,无法获取 range 参数,必须使用
":Fitten explain_code<cr>"
才能获取 Solution: 在 action 检测到目前处于 visual mode,先回到 normal mode,然后 nvim_buf_get_mark 获取 range ('<, '>
要在退出 visual mode 后才会更新), 否则直接从'<, '>
获取 range.
@hoofcushion
API 调用可以简化一下,可以直接在 fittencode
这个模块下访问
require("fittencode").explain_code
@luozhiya Done. But doc/tags This file is changed, and I have no idea how to recovery it. Would you help to see it? I enabled
Allow edits and access to secrets by maintainers
GitHub 上操作好像不太方便,麻烦本地使用一下如下 git 语句
git rm --cache doc/tags
git commit --amend --no-edit
git push --force
好了
@hoofcushion 谢谢
I also formatted this file, if you don't like, you can roll back.