lsp-inlayhints.nvim icon indicating copy to clipboard operation
lsp-inlayhints.nvim copied to clipboard

after commenting multiple lines in lua

Open ChristianChiarulli opened this issue 2 years ago • 3 comments

image

ChristianChiarulli avatar Jul 21 '22 01:07 ChristianChiarulli

Can you try the other branch?

lvimuser avatar Jul 23 '22 16:07 lvimuser

Yup that fixes it, nice work!

ChristianChiarulli avatar Jul 24 '22 06:07 ChristianChiarulli

This seems to a problem with numToStr/Comment.nvim; same behavior with builtin codelens.

The extmarks do not get pushed to the line below when using macros, visual block or vim-visual-multi. As such, I don't think there's anything to be done on our side.

A possible workaround is to clear the ext mark before commenting (https://github.com/numToStr/Comment.nvim#pre-hook)

pre_hook = function(ctx)
  local line_start = (ctx.srow or ctx.range.srow) - 1
  local line_end = ctx.erow or ctx.range.erow
  require("lsp-inlayhints.core").clear(0, line_start, line_end)
  -- or vim.api.nvim_buf_clear_namespace(0, -1, line_start, line_end)
end

lvimuser avatar Jul 28 '22 10:07 lvimuser