3rd / image.nvim

🖼️ Bringing images to Neovim.
MIT License
811 stars 35 forks source link

[BUG] Image display override floating windows #114

Closed rywng closed 5 months ago

rywng commented 5 months ago

Reproduction:

  1. Add a image into markdown: image

  2. open up an floating window, for example using https://github.com/nvim-telescope/telescope.nvim or https://github.com/hrsh7th/nvim-cmp: image

image

lazy.nvim config:

    {
        "3rd/image.nvim",
        lazy = true,
        ft = {
            "markdown", "neorg",
        },
        config = function()
            package.path = package.path ..
            ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;"
            package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;"
            require("image").setup()
        end
    },

Workarounds:

This can be partly worked-around by setting clear_in_insert_mode = true, this will fix overlaying in insert mode floating windows (nvim.cmp), but the error still occurs in telescope, lazy.nvim etc.

System info:

OS: linux

neovim ``` ================================================================= Package Settings ================================================================= app-editors/neovim-0.9.4::gentoo was built with the following: USE="nvimpager -test" ABI_X86="(64)" LUA_SINGLE_TARGET="luajit -lua5-1" FEATURES="userpriv usersandbox merge-sync buildpkg-live assume-digests ipc-sandbox sandbox fixlafiles ebuild-locks usersync preserve-libs multilib-strict sfperms parallel-fetch ccache distlocks unknown-features-warn binpkg-multi-instance unmerge-logs unmerge-orphans xattr config-pro" ```
kitty ``` ================================================================= Package Settings ================================================================= x11-terms/kitty-0.31.0::gentoo was built with the following: USE="wayland -X -test -verify-sig" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_11 -python3_10 (-python3_12)" FEATURES="network-sandbox fixlafiles binpkg-logs binpkg-dostrip usersync parallel-fetch unknown-features-warn userfetch userpriv strict distlocks binpkg-multi-instance preserve-libs pkgdir-index-trusted buildpkg-live unmerge-orphans sfperms ipc-sandbox xattr qa-unresolved-soname-dep" ```
benlubas commented 5 months ago

see these settings:

window_overlap_clear_enabled = true, -- toggles images when windows are overlapped
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },

and issue #49

rywng commented 5 months ago

see these settings:

window_overlap_clear_enabled = true, -- toggles images when windows are overlapped
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },

and issue #49

Enabling these along with clear_in_insert_mode = true partly works, but cmp's window is still overridden in cmdline insert mode:

image

benlubas commented 5 months ago

Yup, that's intentional bc it's in the ignore list. If you want cmp to cause images to unrender you can remove cmp_menu and cmp_docs from that list.

rywng commented 5 months ago

Oh, sorry, my bad, I was in a rush.

So, we need a better occlusion method as mentioned in #49, closing for now.