-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
ij
text object incorrect for multi-line signatures and single-line blocks
#286
Comments
ij
text object selects part of multi-line signatureij
text object always ignores first line of block
ij
text object always ignores first line of blockij
text object always and only ignores first line of block
ij
text object always and only ignores first line of blockij
text object incorrect for multi-line signatures and single-line blocks
Addresses part of #286, dealing with multi-line brackets. Still doesn't work well when the block header is multi-line because of other types of incomplete expressions, e.g. because of dangling binary operators at the end of a line: if x + y == z println("yes") end Another case which is not covered is if code continues in the same line as the header: if x println("yes") return end
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.
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. |
Thanks for the quick fix! For completeness, I'll give another example I found that still doesn't work:
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:
The text was updated successfully, but these errors were encountered: