You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the fts.get function, ft is first processed using vim.filetype.match, and its result is stored in _ft. However, later in the function, when retrieving the icon using nvim-web-devicons, the original ft variable is used instead of _ft.
-- markview/filetypes.luafts.get=function (ft)
local_ft=ft;
ifvim.filetype.match({ filename=string.format("example.%s", _ft) }) then_ft=vim.filetype.match({ filename=string.format("example.%s", _ft) });
endlocalspec=require("markview.spec");
localprovider_name=spec.get({ "preview", "icon_provider" }, { fallback="internal", ignore_enable=true });
localconf= {};
ifprovider_name=="devicons" andpcall(require, "nvim-web-devicons") thenconf.icon, conf.icon_hl=require("nvim-web-devicons").get_icon_by_filetype(
ft, -- 🔴 `_ft` should be used here instead of `ft`
{ default=true }
);
...
📑 Reproduction steps:
Open a markdown file (.md) in Neovim with markview.nvim and nvim-web-devicons enabled.
Create a code block inside the markdown file with the js (JavaScript) filetype:
```js
console.log("Hello!");
```
Check if the icon for the js filetype is displayed in the preview.
🤖 Which branch are you using?
📜 Issue description:
When setting
icon_provider
todevicons
, there is an issue with theft
(filetype) variable declaration.In the
fts.get
function,ft
is first processed usingvim.filetype.match
, and its result is stored in_ft
. However, later in the function, when retrieving the icon usingnvim-web-devicons
, the originalft
variable is used instead of_ft
.📑 Reproduction steps:
.md
) in Neovim withmarkview.nvim
andnvim-web-devicons
enabled.js
(JavaScript) filetype:js
filetype is displayed in the preview.💻 Minimal init:
📜 Logs:
Neovim version:
v0.10.4
✅ Expected behavior:
js
filetype should be recognized correctly, and the corresponding devicon should be displayed.The text was updated successfully, but these errors were encountered: