VSCodeVim / VSCodeVim/Vim

Unexpected horizontal bumps on vertical cursor movement with not-narrow characters and combined characters

Open
#8,944 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

Unexpected horizontal bumps on vertical cursor movement with not-narrow characters and combined characters

For the term "not-narrow", this issue mainly describes about CJK "Wide" characters and "Fullwidth variant" like Fullwidth Latin, etc.
But it seems that the tab characters also trigger this buggy behavior. #8108

To Reproduce
  • Example text

    The quick brown fox jumps over a lazy dog. the quick brown fox
    The quick brown fox jumps over a lazy dog. The quick brown fox jumps over a lazy dog. The quick brown fox jumps over a lazy dog.
    とりなくこゑす / ゆめさませ / みよあけわたる / ひんがしを / そらいろはえて / おきつへに / ほふねむれゐぬ / もやのうち
    Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich
    정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날. 정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날. 정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날.
    정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날. 정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날. 정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날.
    เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า
    鉴于对人类家庭所有成员的固有尊严及其平等的和不移的权利的承认,乃是世界自由、正义与和平的基础。鉴于对人类家庭所有成员的固有尊严及其平等的
    鑑於人類社會個成員儕有個固有尊嚴脫仔平等個脫仔勿移個權利承認,是世界自由、正義脫仔和平個基礎。鑑於人類社會個成員儕有個固有尊嚴脫仔平等個
    

    Each line of string is consist of characters used in

    • English, with full-width latin characters
    • English, with half-width latin characters
    • Japanese
    • German
    • Korean, with Hangul Syllables Unicode block characters
    • Korean, with Hangul Jamo Unicode block characters
    • Thai
    • Mandarin, simplified
    • Mandarin, traditional

    respectively.
    Note that for Thai and Hangul Jamo characters, some groups of Unicode characters can be combined to compose single displayed character.

  • Fonts used to create sample images
    NeoDunggeunmo for latin and korean glyph
    GNU Unifont for fallback.
    Both are 8x16 grid bitmap based monospace-ish font, so glyphs are perfectly aligned.
    (I think this will be reproducible just with Unifont.)

  • Steps

    1. Click left side of the first occuring of full-width character to put cursor.
    2. Press k/j or arrow up/down to move cursor up and down.
Expected behavior

image
Cursor should move vertically, without horizontal movement, follwing marked line on image.

Recorded on VSCode with extensions disabled.
Note that VSCode also has problem with Hangul Jamo Characters. https://github.com/microsoft/vscode/issues/207794

Screenshots

Environment (please complete the following information):
  • Extension (VsCodeVim) version: 1.27.2
  • VSCode version: 1.87.2
  • OS: Windows 11 23H2 22631.3296
Additional context

Foldfix partially fix this bug, but as you know, there's side effects.
Also cursor drifts toward left on unaligned part unlike vanilla VSCode.

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

No source file or test entry point is named. Start by reproducing the provided multilingual sample in VSCodeVim with the listed fonts, moving vertically with k/j and the arrow keys, and compare the behavior with vanilla VS Code. Done means vertical cursor movement no longer causes the reported horizontal bumps or drift for wide, tab, and combined characters.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.