Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose API to replace the open/close functions #205

Open
defr0std opened this issue Feb 7, 2023 · 0 comments
Open

Expose API to replace the open/close functions #205

defr0std opened this issue Feb 7, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@defr0std
Copy link
Contributor

defr0std commented Feb 7, 2023

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,
}
@defr0std defr0std changed the title [feature request] Expose API to get the context programmatically [feature request] Expose API to replace the open/close functions Feb 8, 2023
@lewis6991 lewis6991 added the enhancement New feature or request label Mar 8, 2023
@lewis6991 lewis6991 changed the title [feature request] Expose API to replace the open/close functions Expose API to replace the open/close functions Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants