Closed mushfiq814 closed 1 year ago
The [*-+]
is not it's own node, so this is not trivial. I assume you are using neovim? Then you could write a directive for your queries, that shrinks the capture to the symbol, see https://neovim.io/doc/user/treesitter.html#treesitter-directives
Thanks for the response. I can take a look at custom directives.
I am trying to write custom highlight queries to target list markers such as
list_marker_star
. However, the whitespace that is part of this node (*
) is also being targeted. I wanted to know if it is possible to query for just the[*-+]
character in the list marker nodes using this parser.Details
I am using treesitter in neovim and am trying to use conceal to replace the list markers with something else. Currently using the following query, the
[*-+]
(including the whitespace following the list marker) is replaced with my conceal character (usingX
here for simplicity and for compatibilty with regular fonts) since neovim/vim doesn't support multi character replacements with conceal.The above query will result in
* item 1
becomingXitem 1
whereas I want it to beX item 1
One workaround I have found is to have characters that the terminal emulator automatically assuems to be double width and renders as such but it is not ideal. Is it possible to just replace the marker and ignore the whitespace?
Please let me know if this isn't the right place to ask this question. I have been trying to achieve this for quite a while with no luck. Thank you for this parser!