bug: doesn't attach when buffer has multiple filetypes, including one supported
还没有人认领这个 Issue。
评估
调研方向
首先阅读 issue 指出的 lua/render-markdown/core/manager.lua 第 150 行附近的文件类型比较代码。检查缓冲区的文件类型如何与配置的文件类型进行比较;当文件类型为 markdown.Avante 的缓冲区被识别为包含 markdown,且插件启用时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Neovim version (nvim -v)
0.12.6
Neovim distribution
N/A
Operating system
nixos
Terminal emulator / GUI
kitty
Describe the bug
in https://github.com/avante-corp/avante.nvim, I want to assign the buffer multiple filetypes with set ft=markdown.Avante, as supported by vim ( see :h ft "When a dot appears in the value then this separates two filetype names, it should therefore not be used for a filetype. ").
This plugin does an exact string compareason at https://github.com/MeanderingProgrammer/render-markdown.nvim/blob/8e8795368391036643b622875a6da6a51bcd33f4/lua/render-markdown/core/manager.lua#L150 which fails when it compares "markdown" with "markdown.Avante". So render-markdown is not enabled while it should.
I believe nvim_get_option_value should return an array for "ft" but until it does, render-markdown could split the return filetypes on . and compare those
Expected behavior
avante should detect that ft contains the "markdown" and be enabled.
Healthcheck output
it's all green
Plugin configuration
require('render-markdown').setup({
-- enabled = true,
-- debounce = 100,
log_level = 'error',
log_runtime = false,
-- to appease checkhealth
html = { enabled = false },
-- use recommended settings from above
file_types = { 'markdown', 'Avante',
-- 'markdown.Avante' -- workaround
},
})
Plugin error log
empty
Confirmations
- I have updated this plugin to the latest version using my plugin manager
- I have updated all treesitter parsers (:TSUpdate)
- I have provided the text contained in all screenshots as raw text in this issue. This means if there is a screenshot below it is the copy pasted contents of the file in the screenshot. I understand that my issue will be closed if I have not.
Additional information
No response
- 主要语言
- Lua
- 星标
- 5.2k
- 派生
- 152
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MeanderingProgrammer/render-markdown.nvim 的其他 Issue
-
feature: allow concealing latex code可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭enhancement
难度 3/5 1-2 天 新手友好度 65/100
MeanderingProgrammer/render-markdown.nvim#717 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 57/100
-
难度 5/5 一周以上 新手友好度 38/100
MeanderingProgrammer/render-markdown.nvim#711 · 1 条评论 ·
-
enhancement
难度 4/5 3-5 天 新手友好度 55/100
-
bug
难度 4/5 1-2 天 新手友好度 55/100
查看 MeanderingProgrammer/render-markdown.nvim 的全部 Issue
相似的 Issue
-
severity: low
难度 2/5 1-3 小时 新手友好度 76/100
luainkernel/lunatik#2372 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
bug confirmed discord guide:tyrs-watch locale:enUS navigation v0.3.2
难度 2/5 1-3 小时 新手友好度 67/100
fitzforge/polestar#855 · 1 条评论 ·
维护者通常 1 天内回复
-
translation
难度 2/5 1-3 小时 新手友好度 64/100
KristanLaimon/PanelsPlus#16 ·
-
Bug
难度 1/5 1 小时以内 新手友好度 91/100
DennisRas/WeeklyKnowledge#164 ·