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

✨ Feature: expose an API "is_enabled" #221

Closed
1 of 4 tasks
sadtab opened this issue Dec 14, 2024 · 2 comments
Closed
1 of 4 tasks

✨ Feature: expose an API "is_enabled" #221

sadtab opened this issue Dec 14, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@sadtab
Copy link

sadtab commented Dec 14, 2024

The nature of the feature:

  • Parser(syntax, conceal etc. related)
  • Renderer(style, options etc. related)
  • Support(plugin support, language support etc. related)
  • Other

Description:

Dear the most awesome in-phone developer of all time,

could you expose an API like

require("markview").commands.is_enabled(buf)
@sadtab sadtab added the enhancement New feature or request label Dec 14, 2024
Copy link

🤖 Bot: Issue has not seen activity in 30 days and will therefore be marked as stale. It will be closed in 7 days if no further response is found.

@OXY2DEV
Copy link
Owner

OXY2DEV commented Jan 13, 2025

I forgot to reference this issue but on dev you can use these functions now,

local actions = require("markview").actions;

--- Checks if markview is attached to a buffer or not.
actions.__is_attached(buffer);

--- Checks if markview is enabled on a buffer or not.
actions.__is_enabled(buffer);

--- Allows executing `callbacks` without needing to check if they exist or not.
actions.__exec_callback(callback, ...);

If there is some advanced use case than you can also use these functions,

local markview = require("markview");

--- Cleans up invalid buffers from the list of attached buffer and detaches from them.
markview.clean();

--- Checks if a buffer is safe to draw in
markview.buf_is_safe(buffer);

--- Checks if a buffer can be attached to.
markview.can_attach(buffer);

--- Checks if drawing preview is possible on a buffer.
markview.can_draw(buffer);

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