Skip to content
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

Cannot insert at the start of lines with visual block #1633

Closed
opeik opened this issue Apr 19, 2020 · 4 comments · Fixed by #3011
Closed

Cannot insert at the start of lines with visual block #1633

opeik opened this issue Apr 19, 2020 · 4 comments · Fixed by #3011
Labels
A-vim Area: Vim/modal editing bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor U-libvim Upstream: Potentially dependent on changes in libvim

Comments

@opeik
Copy link

opeik commented Apr 19, 2020

out

After creating a visual block, pressing I doesn't seem to do anything. Pressing c on the other hand does work, but consumes the first character as you'd expect.

Steps to reproduce:

  • Create a visual block selection (Control-Q) containing only the first character of every line
  • Press I to enter insert mode

Expected behaviour:

  • You enter insert mode at the start of every line

Actual behaviour:

  • Nothing happens
@glennsl glennsl added A-vim Area: Vim/modal editing bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor U-libvim Upstream: Potentially dependent on changes in libvim labels Apr 19, 2020
@Apostolique
Copy link

The same issue happens with regular visual mode. I and A.

@mtippett
Copy link

I've looked into it a bit under LiveDebug (https://www.twitch.tv/bastiondebugging).

It looks like libvim isn't handling the block mode correctly. I'll be updating the visual_mode tests to demonstrate for comparison. Observations are (using unit test hacks)...

Starting file is

line1
line2
line3
line4
line5

The test_insert_block_mode is modified to comment out the viminput("") and ("j") (ie: just doing a straight insert). Output is

LINE: abcline1
LINE: line2
LINE: line3

When the visual mode is used, with "I", it will produce

LINE: line1
LINE: line2
LINE: line3

expected

LINE: abcline1
LINE: abcline2
LINE: abcline3

When visual mode is used with "c", it will product

LINE: abcine1
LINE: ine2
LINE: ine3

Expected

LINE: abcine1
LINE: abcine2
LINE: abcine3

I'll construct a pull request for these tests in the next debug run.

@77abe77
Copy link

77abe77 commented Oct 15, 2020

Any update on this issue? I am still experiencing this on latest build c771129

@HealsCodes
Copy link

HealsCodes commented Dec 9, 2020

Also still in 4aa0458 but since it's probably a libvim issue it might be better situated in that repo.

Possibly related to these two TODOs libvim/src/normal.c#L1546, libvim/src/normal.c#L1553 - as far as I can climb through the flow of visual block handling those are the difference to regular vim.

bryphe added a commit that referenced this issue Jan 19, 2021
__Issue:__ `I` and `A` in visual-block mode should allow inserting, or appending, characters across all linewise selections in the visual block

__Fix:__ Implement using our in-progress multi-cursor support:

![2021-01-19 12 02 59](https://user-images.githubusercontent.com/13532591/105086839-7746a700-5a4e-11eb-9a44-c984d27ae6bc.gif)

Functionally, this should behave the same as `<c-v>`+`I`/`A`, but show all insertions during the gesture (as opposed to Vim, which would only show a single insertion, and then propagate them on the `<esc>` press).

A baby step towards snippets & multiple cursors

Fixes #1633 
Related #1551
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vim Area: Vim/modal editing bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor U-libvim Upstream: Potentially dependent on changes in libvim
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants