[vim/vim] Multi-line visual block `1v` past EOL (virtualedit) has incorrect size (Issue #20746)

2 views
Skip to first unread message

Alex Yang

unread,
Jul 10, 2026, 3:18:04 PM (24 hours ago) Jul 10
to vim/vim, Subscribed
aycyang created an issue (vim/vim#20746)

Steps to reproduce

  1. Invoke Vim with no vimrc and this test file: printf "###\n###\n###\n#####\n" | vim -u NONE -

    The buffer should look like this:

    ###
    ###
    ###
    #####
    
  2. Move cursor to first character: gg

  3. Enter Visual block mode: ^v

  4. Yank a 3x3 selection: lljjy

  5. Turn on virtualedit: :set virtualedit=all

  6. Move cursor to line 2, column 6 (any column >= 5 will do): :call cursor(2, 6)

  7. 1v

At this point I observe a selection size of 1x3, but it should be 3x3.

Other notes:

  • Bug seems to trigger only when the starting line is 2 or more characters shorter than the ending line.

Expected behaviour

Visual block mode selection should be of size 3x3.

Version of Vim

9.2.0782

Environment

OS: macOS Tahoe 26.5.1 (25F80)
Terminal: iTerm2 3.6.11
$TERM: xterm-256color
Shell: GNU bash, version 5.3.3(1)-release (aarch64-apple-darwin24.4.0)

Logs and stack traces


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20746@github.com>

Reply all
Reply to author
Forward
0 new messages