fix nvim: 圖片顯示在GUI不支援,要動態關閉
This commit is contained in:
parent
3863c62bdc
commit
3519892943
@ -2,6 +2,22 @@ return {
|
|||||||
{
|
{
|
||||||
"3rd/image.nvim",
|
"3rd/image.nvim",
|
||||||
build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239
|
build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239
|
||||||
|
-- cond = not vim.g.neovide and not vim.fn.has("goneovim") == 1 and not vim.fn.has("gui_running") == 1,
|
||||||
|
cond = function()
|
||||||
|
-- 如果是在 GUI(如 NeoVide、Goneovim)中,則不啟用插件
|
||||||
|
if vim.g.neovide or vim.fn.has("goneovim") == 1 or vim.fn.has("gui_running") == 1 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 獲取 TERM 環境變數
|
||||||
|
local term = vim.fn.getenv("TERM")
|
||||||
|
-- 檢查是否是常見的文字終端
|
||||||
|
local is_terminal = term and (term:match("xterm") or term:match("screen") or term:match("tmux") or term:match("linux"))
|
||||||
|
|
||||||
|
-- 如果是文字終端,則啟用插件
|
||||||
|
return is_terminal ~= nil
|
||||||
|
end,
|
||||||
|
lazy = false,
|
||||||
opts = {
|
opts = {
|
||||||
backend = "ueberzug",
|
backend = "ueberzug",
|
||||||
processor = "magick_cli", -- or "magick_rock"
|
processor = "magick_cli", -- or "magick_rock"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user