luckasRanarison/clear-action.nvim

enhancement: allow max length for label, prevent label from covering up buffer content

unphased opened this issue · 2 comments

The labels are often long and they actually cover up the buffer. Both of these features should be provided in order for show_label to be worth using. And if we dont show the label then all we can get are the counts which is not really enough to justify using.

Example

image

There's already the label_fmt option, you could do something like this:

{
  sings = {
    label_fmt = function(actions)
      local title = actions[1].title
      return #title < 20 and title or title:sub(1, 20) .. "..." -- truncating
    end
  }
}

Fantastic.