3rd / image.nvim

🖼️ Bringing images to Neovim.
MIT License
1.18k stars 52 forks source link

Image is not rendered if it's on the first line of the file #164

Open Sergih28 opened 7 months ago

Sergih28 commented 7 months ago

Steps to reproduce: Create a markdown file like:

![neovim logo](https://static-00.iconduck.com/assets.00/apps-neovim-icon-2048x2048-21jvoi4h.png)

![neovim logo](https://static-00.iconduck.com/assets.00/apps-neovim-icon-2048x2048-21jvoi4h.png)

![neovim logo](https://static-00.iconduck.com/assets.00/apps-neovim-icon-2048x2048-21jvoi4h.png)

You will see that if you add an empty line on the first line, the first image will show, otherwise it will not. The rest of the images are always shown (as long as they fit the screen ofc).

I'm using a fresh installation of the plugin, I followed the readme and installed all the necessary dependencies.

This is my config. TLDR, I'm using Alacritty and ueberzug backend (it works fine with ranger), just tweaked the max sizes so that I the images don't fill up most of my screen, and set to true clear_on_insert_mode.

My config ```lua { "vhyrro/luarocks.nvim", priority = 1001, -- this plugin needs to run before anything else opts = { rocks = { "magick" }, }, }, { "3rd/image.nvim", dependencies = { "luarocks.nvim" }, config = function() require("image").setup({ backend = "ueberzug", integrations = { markdown = { enabled = true, clear_in_insert_mode = true, download_remote_images = true, only_render_image_at_cursor = false, filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here }, neorg = { enabled = true, clear_in_insert_mode = true, download_remote_images = true, only_render_image_at_cursor = false, filetypes = { "norg" }, }, html = { enabled = false, }, css = { enabled = false, }, }, max_width = 50, max_height = 50, max_width_window_percentage = 90, max_height_window_percentage = 50, window_overlap_clear_enabled = false, -- toggles images when windows are overlapped window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off) hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened }) end, }, ```
3rd commented 7 months ago

Seems like something introduced recently, reproduced with Kitty. Will investigate, thanks for the issue!