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

fix line end determination for a, A, $ #68

Merged
merged 1 commit into from
Dec 2, 2015

Conversation

kimitake
Copy link
Contributor

@kimitake kimitake commented Dec 1, 2015

fix line end determination for a, A, $

@jpoon
Copy link
Member

jpoon commented Dec 1, 2015

This looks/feels like a hack. I think we need to differentiate between a cursor and a caret. it may be more proper to separate this into separate classes -- cursor class (in which insert mode will use) and a caret class (in which command mode will use).

Considering the current PR, every method in the cursor class will need this new function parameter as the same bug exists for lineEnd and documentEnd.

@kimitake kimitake force-pushed the fix-lineend branch 3 times, most recently from c82c7ae to 2d63075 Compare December 2, 2015 08:16
@kimitake
Copy link
Contributor Author

kimitake commented Dec 2, 2015

just created Caret class which is derived from Cursor class, and defined "maxLineLength" method for override between Caret and Cursor class.
And normal mode uses Caret class instead of Cursor.
How about this?

assert.equal(current.line, 0);
assert.equal(current.character, 7);

let right = Cursor.right();
let right = Caret.right();
assert.equal(right.line, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this test suite focused on the Cursor class? Keep using the Cursor functions but change the expected values on the asserts?

@jpoon
Copy link
Member

jpoon commented Dec 2, 2015

👍 Just one note. After that, we can mergeeeeee!

"right on right-most column should stay at the same location" is for Caret not Cursor
@kimitake
Copy link
Contributor Author

kimitake commented Dec 2, 2015

Is this correct?

jpoon added a commit that referenced this pull request Dec 2, 2015
fix line end determination for a, A, $
@jpoon jpoon merged commit 9c01d76 into VSCodeVim:master Dec 2, 2015
@kimitake kimitake deleted the fix-lineend branch December 5, 2015 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants