Skip to content

Expose API to replace the open/close functions #205

Open
@defr0std

Description

I would like to display the treesitter context a little differently - in a winbar via other plugins like LuaLine or Feline. Those plugins already provide you with the custom sections where you can put any arbitrary text, and this text in my case would be the treesitter context hierarchy.

Would it be possible to allow overriding the built-in open/close function? When a user-supplied function is specified, then the plugin will not draw any UI.

Example:

require'treesitter-context'.setup{
  -- ...
  on_open = function(ctx) 
    -- ctx here is for example an array of items to display, it could have some additional properties as needed.
  end,
  on_close = function() 
  end,
}

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions