presence.nvim icon indicating copy to clipboard operation
presence.nvim copied to clipboard

Add support for debuggers and allow configuring line number location

Open notjl opened this issue 4 years ago • 2 comments

Amazing plugin and works pretty well. It offers more than any rpc for nvim. But is it possible to have more customization?

Ideas:

  • Change button label.
  • Display current line/total lines (may it be on details or lower details).
  • When using nvim-dap, display when debugging file.

notjl avatar Feb 01 '22 16:02 notjl

Hi @notjl, thanks for the praise, and the ideas!

  • Change button label.

This should actually be achievable with the buttons setup option introduced in #27! There's no explicit "button label" option, but you can use a function to configure the label like this:

require("presence"):setup({
    buttons = function(buffer, repo_url)
        if repo_url then
            return {{
                label = "I am a custom label",
                url = repo_url,
            }}
        end
    end,
})

Admittedly it's fairly verbose, but I'd rather not introduce an explicit option since it may conflict with the existing buttons option, i.e. if both are configured.

  • Display current line/total lines (may it be on details or lower details).

Definitely a fair suggestion! I don't personally use this option but I did think it would make more sense to have the line numbers below as the secondary text.

I've added a card for this that you can check out here.

  • When using nvim-dap, display when debugging file

This is a great idea! It may be a little tougher to implement however, though I can't say for sure since I personally don't use nvim-dap. Can you share what currently is shown as Rich Presence when debugging using nvim-dap?

I've added a card for this that you can check out here. It might be cool to support debuggers in general so I've also added others to support like vimspector, nvim-gdb, etc.

andweeb avatar Feb 01 '22 20:02 andweeb

Hi @andweeb, sorry for the late response. It seems nvim-dap doesn't display any changes in the Rich Presence. It may be because I'm using it on Windows. I'll try it again once I completely to GNU/Linux.

notjl avatar Feb 08 '22 02:02 notjl