actions-preview.nvim icon indicating copy to clipboard operation
actions-preview.nvim copied to clipboard

don't force regex highlighting

Open jan-xyz opened this issue 1 year ago • 4 comments
trafficstars

The current highlighter is using the regex highlighter per default, this tries to do it with tree sitter and if fails uses the regex highlighting.

image

jan-xyz avatar Mar 04 '24 21:03 jan-xyz

Thank you! However, it seems that the syntax highlighting is not correct, especially on the first line.

before

image

after

image

aznhe21 avatar Mar 09 '24 18:03 aznhe21

I think that's a problem with the tree-sitter parser. I also noticed that in other diff scenarios.

jan-xyz avatar Mar 09 '24 20:03 jan-xyz

the problem is now fixed, the tree sitter parser only allows diff --git ... as a command to parse the output.

jan-xyz avatar Mar 15 '24 10:03 jan-xyz

Here is the currently hard-coded --git: https://github.com/the-mikedavis/tree-sitter-diff/blob/c165725c28e69b36c5799ff0e458713a844f1aaf/grammar.js#L68

jan-xyz avatar Mar 15 '24 10:03 jan-xyz

+1 - this would be great to get merged.

dsully avatar Apr 26 '24 19:04 dsully

The git parser for treesitter fixed the problem upstream and should be fine now, @aznhe21

jan-xyz avatar Apr 26 '24 19:04 jan-xyz

+1

rubiin avatar May 03 '24 07:05 rubiin

Apologies for the delayed response. Thank you for addressing this!

aznhe21 avatar May 03 '24 14:05 aznhe21