-
Notifications
You must be signed in to change notification settings - Fork 16
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
Inconsistent behavior in visual mode #32
Comments
The text I'm playing around as test case:
Result objective:
|
My only approach right now is to break with the block-visual mode and align each part, the objective would be to align it without having to break it down into pieces (breaking it down with the selection block) |
Do you have |
That said, I think that feature needs some refinement. It shouldn't squeeze out spaces related to another alignment. I'll consider this a bug. |
I do have that option set to 1. Setting it to 0, that solves the problem, but I do like that option. As you said it would be great if it would work with the option on. Thank you for the outstanding plugin once again. |
@blasco did you try to align in visual block mode, only selecting the block you want to align? Anyway, in my fork I added mappings to have both behaviours, without needing to set the option. https://github.com/mg979/vim-lion/commit/305e038b345a94437f7d579b3ebde1355cbe4761 If there's interest from @tommcdo I could make a PR. I changed the mappings, though:
I know |
I actually just confirmed that even with a Visual Block selection that starts to the right of the aligned text, those spaces to the left will be squeezed when I think the expected behaviour would be that only spaces related to the targeted alignment character should be affected. If any spaces are skipped (either by Visual Block selection or by supplying a count), they should not be squeezed. |
Replacing Line 77 in 75306ac
with
should fix it Edit: let pre = visualmode() ==# "\<C-v>" ? '\%>'.pos[5].'c' : ''
call setline(lnum, substitute(getline(lnum), pre.'\(^\s*\)\@<! \{2,}', ' ', 'g')) |
Looking forward to the update :) |
First of all, I think this operator is great! I'm observing some strange behavior that I think we could improve. As an example, I have this:
If I select a region and I perform the alignment operator with the '(' character as target, I get his:
Which breaks the previous parts, which are not selected.
If I break the paragraph in two, then it works as I would expect:
Would it be possible to have the same behavior without having to break in blocks the paragraph? I don't want that the alignment of the unselected zone gets affected, so I can align part by part.
The text was updated successfully, but these errors were encountered: