-
Notifications
You must be signed in to change notification settings - Fork 13
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
Removal of whitepsace surround operators on 'J'oin lines #35
Comments
This looks like a bug in removing spaces in slices. I think it's treating the |
Oh man, how did I miss that? I feel like a fool. Thanks so much. And I'm no good with vimscript, but why not? I'll see what I can find tonight. ;) |
Okay, did some digging and found the offending line in
This removes all surrounding whitespace from the the operators
What do you think? Also of note, this doesn't handle the problem of not actually caring whether it's a slice or not, but I feel like the same rules apply either way. A case could be made for handling slices with arithmetic operators (as seen in Pet Peeves: |
I'm experiencing something similar to this for empty strings in pythong. Is there any update? example:
is changed to
|
I'm still thinking about this, lol. Given the rise of Black, would it make sense to remove the whitespace trimming? My original example:
is reformatted by Black as:
I realize this would be a "big" change, but seeing as it's potentially causing data loss (I can't recreate siavasht's issue, but I trust it's happening), I think fully removing this part might be smartest. |
Back again with another odd interaction! Test code:
Move the cursor to the first line and press
J
to join the line below. On my machine, it removes all whitespace surrounding the+
and*
operators:test = [x+1 for x in range(2*2)]
This also happens with
-
and/
. If I disable the plugin, this behavior disappears. Just to be sure, I left braceless.vim enabled and tried disabling every other plugin I have install one at a time, and braceless.vim is the only one that seems to interact with this.Thanks!
The text was updated successfully, but these errors were encountered: