Open nick4f42 opened 2 years ago
I have just pushed a fix for the issue in the first example. Unfortunately, fixing the one-line blocks and other cases is very, very hard. That's because that basically requires a full-fledged julia code parser. Examples of things that still create problems after the fix:
if x + y ==
z + k
println("yes")
end
if x == z + k println("yes")
return
end
In order to deal with those correctly, we'd need a parser that can tell when an expression is completed. Doing it with brackets is not too hard, but when the tokens that determine the parsing are in the middle (like for binary operators) and there is whitespace dependency (e.g. a [3]
is not the same as a[3]
in this context) then things become very complicated to implement in vim script. It might be doable by leveraging syntax highlighting (as we do with brackets) but that would likely make the syntax highlighting even more horribly slow than it is already.
Thanks for the quick fix! For completeness, I'll give another example I found that still doesn't work:
where
statement of a function is on a different line, it's included in ij
function f(
x::T
) where T
return T
end
The
ij
text object includes some of a function signature if it spans multiple lines:It doesn't select anything if the entire block is on one line, like this: