VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.97k stars 1.32k forks source link

Replace in-house `Range` class with richer `Cursor` class #4585

Open J-Fields opened 4 years ago

J-Fields commented 4 years ago

Probably, this should subclass vscode.Selection. The first step is to remove uses of (our) Range to represent simple ranges within a document - these should use vscode.Range.

The most pressing reason for this is to have a desiredColumn per cursor. Put the following into a new document, with | representing a cursor on lines 1 and 3:

|shortword
looooooonnnnnggggggword
|looooooonnnnnggggggword
looooooonnnnnggggggword

Press e then j; observe that the bottom cursor is in line with the top one

J-Fields commented 4 years ago

This is also the case for visualLineStartColumn. (This no longer exists)

We pass around Ranges as "cursors". I'm beginning to think we should make a Cursor class that's passed around and encapsulates this sort of data...