Open Perry3D opened 6 months ago
I thought about that too. Certain filetypes have the same issue quite frequently. One challenge around that is when the line above doesn't have any useful information or information you don't want in it.
{
"key1": "val1",
},
{
"key1": "val2",
},
This for example would fall into the same category, but wouldn't be solved by grabbing the line above.
One possible solution would be to check the line above for length > 1 if the length of the match is 1 and then return the line above if it is.
if len(matchingLine) == 1 {
if len(lineAbove) > 1 {
return lineAbove
}
return matchingLine
}
Something like that as the test. Do you have a better idea how to logically and correctly pick the correct line to display?
Why are you not using treesitter? It should show you the correct line without worrying about formatting.
The latest version does not use treesitter, but I was using it to check for the correct filetype so that the plugin doesn't activate on non-code buffers. The latest version just checks for the filetype directly.
Hello,
great plugin. I love it.
Some of my projects force the opening paren in cpp files on the next line. The result looks like this:
Is it possible to show the if line (69) instead of the opening paren (70)?