Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 fittencode.nvim 插件时遇到 "invalid key: force" 错误 #20

Open
zengtianli opened this issue Apr 9, 2024 · 1 comment
Open

Comments

@zengtianli
Copy link

你好,fittencode.nvim 的维护者。我在使用你的插件时遇到了一个问题,希望能得到你的帮助。

当我在 Neovim 配置文件中加载 fittencode.nvim 插件时,Neovim 报告了以下错误:

Copy code
| lazy.nvim: Failed to run config for fittencode.nvim
▲ 64 local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.
▲ 63 if not vim.loop.fs_stat(lazypath) then .../share/nvim/lazy/fittencode.nvim/lua/fittencode/base.lua:45: invalid key: force
▲ 62 │ vim.fn.system({
61 │ ¦ "git", # stacktrace:
60 │ ¦ "clone", - /fittencode.nvim/lua/fittencode/base.lua:45 in set_hi
59 │ ¦ "--filter=blob:none", - /fittencode.nvim/lua/fittencode/color.lua:13 in setup_highlight
58 │ ¦ "https://github.com/folke/lazy.nvim.git", - /fittencode.nvim/lua/fittencode/init.lua:18 in setup
57 │ ¦ "--branch=stable", -- latest stable release - ~/.config/nvim/lua/config/plugins/fittencode.lua:6 in config
56 │ ¦ lazypath, - ~/.config/nvim/lua/config/plugins.lua:31
55 │ }) - ~/Documents/sync/nvim/init.lua:3
根据错误信息,问题似乎出在 base.lua 文件的第 45 行,其中使用了一个无效的键名 "force"。

我的 fittencode.nvim 配置文件 (fittencode.lua) 如下:

lua

Copy code
return
{
'luozhiya/fittencode.nvim',
config = function()
require('fittencode').setup()
end,
}
我已经尝试过更新和回退 fittencode.nvim 插件的版本,但问题仍然存在。

复现步骤:

在 Neovim 配置文件中添加上述 fittencode.lua 配置。
启动 Neovim。
观察到报告的 "invalid key: force" 错误。
环境信息:

Neovim 版本:NVIM v0.10.0-dev-c4f4c7a
fittencode.nvim 版本: "fittencode.nvim": { "branch": "master", "commit": "c2bb842bd1257a157c8bb443d5e07199fe43d7dc" },
操作系统:Darwin Kernel Version 23.4.0: Wed Feb 21 21:45:49 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6020 arm64

@luozhiya
Copy link
Owner

@zengtianli 您好

force 选项是在 fix(highlight): add force in nvim_set_hl by glepnir · Pull Request #25229 · neovim/neovim 中添加的,commit 时间晚于 c4f4c7a

但是现在 Neovim 没有检测 commit 和 nvim_set_hl 选项有效性的 API,只能暂时先不设置这个了。

请您更新一下 fittencode.nvim,应该没问题了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants