-
Notifications
You must be signed in to change notification settings - Fork 7
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
Unmatched single quotes make SidewaysArgumentTextobjI jump to unrelated line #34
Comments
I suppose an argument against fixing this would be even more egregious cases of invalid code:
But as a user, it makes sense that the only up to the first comma is quoted. Jumping several lines down when Regardless, I accept this is an edge case. I understand if you want to close as wontfix : ) |
As you've guessed, sideways generally expects the code to be valid in order for it to work. There's some permissiveness, like The "parser" is not particularly smart. I figure the best I can do is rely on Vim to jump from opening to closing bracket, and consider delimiters -- that works well with nested lists as well. But figuring out what to do in your example case seems impossible to me. I assume even Vim would syntax-highlight the rest of the line as a string? The annoying thing in this case is probably the jumping -- if it didn't do anything, it'd probably be better than doing the wrong thing. I've had similar annoyances with other situations. But I can't think of a way to avoid it -- the multiline functionality is quite useful, and there are valid cases where quoted strings can be multiline (like in Rust): call_function(
one,
r#"
two
three
"#,
four
) I wonder if it would make sense to maintain a pair of "multiline_brackets" and one for "single_line_brackets" -- brackets like |
In my experience, multiline strings are usually not delimited with |
Similar to #24.
If I type some text and use Sideways to add quotes, it fails when the text has an unmatched quote (single or double) and later in the file there's a matching quote.
With file test.cs:
I guess it's interpreting
' breaks surrounding text with quotes, this);
as a string that continues past the end of the line. My syntax highlighting (nickspoons/vim-cs) doesn't, but maybe sideways has its own way to determine what's a string?Initially found on 01bcf0f, but also reproduced on 9dd871e.
The text was updated successfully, but these errors were encountered: