VSCodeVim / VSCodeVim/Vim

visual block mode select error

Open
#3,895 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug
After I enter visual block mode with Ctrl-V, I try to use Shift+I to insert something, but it seems to get the wrong row.

To Reproduce
I have such context:

#define atomic64_inc_and_test(v)	[my cursor](atomic64_inc_return(v) == 0)
#define atomic64_dec_and_test(v)	(atomic64_dec_return(v) == 0)
#define atomic64_sub_and_test(i, v)	(atomic64_sub_return((i), (v)) == 0)
#define atomic64_add_negative(i, v)	(atomic64_add_return((i), (v)) < 0)
#define atomic64_add_unless(v, a, u)	(___atomic_add_unless(v, a, u, 64) != u)

Ctrl+V and Shift+I and j to go down
I would like to insert before

[my cursor](atomic64_inc_return(v) == 0)
(atomic64_dec_return(v) == 0)
(atomic64_sub_return((i), (v)) == 0)
(atomic64_add_return((i), (v)) < 0)
(___atomic_add_unless(v, a, u, 64) != u)

but I got

[my cursor](atomic64_inc_return(v) == 0)
(atomic64_dec_return(v) == 0)
)	(atomic64_sub_return((i), (v)) == 0)
)	(atomic64_add_return((i), (v)) < 0)
 u)	(___atomic_add_unless(v, a, u, 64) != u)

Expected behavior
I don't know whether it is a bug or my operation is wrong. Thanks a lot.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in VS Code using the shown five-line context and the Ctrl-V, Shift-I, then j sequence. Compare the visual block selection and insertion behavior with the expected output; the work is done when insertion occurs before every selected row without moving or truncating text.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.