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

feature: Statusline: Get current scope name

Open catgoose opened this issue 10 months ago • 0 comments

Did you check the docs?

  • [x] I have read the Grapple docs

Is your feature request related to a problem? Please describe.

I want to show the current scope in my heirline config

Describe the solution you'd like

If I could get scope name from something like require("grapple").scope_name(), similar to require("grapple").name_or_index()

Then I could define heirline block like:

  local GrappleBlock = {
    condition = function()
      return package.loaded["grapple"] and require("grapple").exists()
    end,
    hl = {
      fg = colors.springBlue,
      italic = true,
    },
    provider = function()
      local g = require("grapple")
      return ("%s: %s"):format(g.scope_name(), g.statusline())
    end
  }

Describe alternatives you've considered

Read documentation and looked at code

Additional context

No response

catgoose avatar Feb 21 '25 20:02 catgoose