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

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

Open
Sergih28 opened this issue May 4, 2024 · 1 comment
Open

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

Sergih28 opened this issue May 4, 2024 · 1 comment

Comments

@Sergih28
Copy link

Sergih28 commented May 4, 2024

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
{
  "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
Copy link
Owner

3rd commented May 5, 2024

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

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