Skip to content

feature: resize LSP hover windows based on concealed lines #384

@ValdezFOmar

Description

@ValdezFOmar

Neovim version (nvim -v)

0.11.0

Neovim distribution

N/A

Operating system

Linux

Terminal emulator / GUI

Kitty

Describe the bug

I've noticed that even though the backticks for code blocks are concealed, there is still an additional two lines at the end of hover windows:

Without this plugin:

Image

With this plugin:

Image

Expected behavior

The hover window should not have this extra lines, just like the first capture.

Healthcheck output

==============================================================================
render-markdown:                     require("render-markdown.health").check()

render-markdown.nvim [version] ~
- OK plugin 8.1.22
- OK neovim >= 0.10

render-markdown.nvim [configuration] ~
- OK valid

render-markdown.nvim [treesitter] ~
- OK markdown: parser installed
- OK markdown_inline: parser installed
- WARNING latex: parser not installed
  - ADVICE:
    - Disable latex support to avoid this warning
    - require('render-markdown').setup({ { latex = { enabled = false } })
- WARNING html: parser not installed
  - ADVICE:
    - Disable html support to avoid this warning
    - require('render-markdown').setup({ { html = { enabled = false } })
- OK markdown: highlight enabled

render-markdown.nvim [icons] ~
- WARNING none installed

render-markdown.nvim [executables] ~
- WARNING latex2text: not installed
  - ADVICE:
    - Disable latex support to avoid this warning
    - require('render-markdown').setup({ { latex = { enabled = false } })

render-markdown.nvim [conflicts] ~
- OK headlines: not installed
- OK markview: not installed
- OK obsidian: not installed

Plugin configuration

{                                                                                                                                                                           
  overrides = {                                                                                                                                                             
    buftype = {                                                                                                                                                             
      nofile = {                                                                                                                                                            
        code = {                                                                                                                                                            
          border = "hide",                                                                                                                                                  
          style = "normal"                                                                                                                                                  
        }                                                                                                                                                                   
      }                                                                                                                                                                     
    }                                                                                                                                                                       
  }                                                                                                                                                                         
}

Plugin error log

N/A

Confirmations

  • I have updated this plugin to the latest version using my plugin manager
  • I have provided the text contained in all screenshots as raw text in this issue. This means if there is a screenshot below it is the copy pasted contents of the file in the screenshot. I understand that my issue will be closed if I have not.

Additional information

I can reproduce this behaviour with the following steps:

git clone https://github.com/MeanderingProgrammer/render-markdown.nvim.git
git clone https://github.com/nvim-treesitter/nvim-treesitter.git
./nvim-linux-x86_64.appimage --clean -u init.lua a.lua

nvim-linux-x86_64.appimage is the official appimage build.

a.lua

function f() end

init.lua:

vim.lsp.config.luals = {
    cmd = { 'lua-language-server' },
    filetypes = { 'lua' },
}

vim.lsp.enable('luals')

vim.o.winborder = 'rounded'

vim.opt.rtp:prepend './nvim-treesitter'

require('nvim-treesitter.configs').setup({
    ensure_installed = {
        'markdown',
        'markdown_inline',
    },
    highlight = { enable = true },
})

vim.opt.rtp:prepend './render-markdown.nvim'

require('render-markdown').setup({
    overrides = {
        buftype = {
            nofile = {
                code = {
                    style = 'normal',
                    border = 'hide',
                },
            },
        },
    },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions