preservim / vim-pencil

Rethinking Vim as a tool for writing
Other
1.57k stars 38 forks source link

Unexpected behavior with SoftPencil and Visual Block #68

Closed xaviervalarino closed 4 years ago

xaviervalarino commented 6 years ago

When using :SoftPencil with V-BLOCK, I get some unexpected behavior.

I use V-BLOCK often to select a range of text and then add something to the end of each line.

As an example, if I want to add a comma after each line of the lorem ipsum shown below, I'll visually select the range and append a comma.

So the keystrokes would be: <C-v> G $:

screen shot 2018-03-30 at 11 07 09 am

Followed by: A , <Esc>:

screen shot 2018-03-30 at 11 07 44 am

But, when I have Soft Pencil enabled, V-Block selects all the way to the end.

screen shot 2018-03-30 at 11 08 34 am

Obviously I can simply run :PencilOff beforehand, but I usually have to actually make the selection before I remember what's going on.

alerque commented 4 years ago

This appears to have been caused by $ still being mapped to the hard end of line (which is soft mode is basically end of paragraph). I've fixed that mapping in #82 and I think this will work as you expect now. At least your example does for me as best I can mimic it.

Please feel free to comment back and re-open this is for some reason it doesn't work right.