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

fixes #784 #814

Merged
merged 2 commits into from
Oct 5, 2016
Merged

fixes #784 #814

merged 2 commits into from
Oct 5, 2016

Conversation

xconverge
Copy link
Member

Yay! We love PRs! 🎊

Please include a description of your change and ensure:

  • Commit message has a short title & issue references
  • Each commit does a logical chunk of work.
  • It builds and tests pass (e.g gulp)

More info can be found on our contribution guide.

let stop = Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.end);

// We want to swap the cursor start stop positions based on which direction we are moving, up or down
if (start.line < position.line) {
Copy link
Member

Choose a reason for hiding this comment

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

You can do a swap like this: [a, b] = [b, a]

You could also write this whole block like this:

return { start: Position.earlierOf(start, stop), stop: Position.laterOf(start, stop) }

Copy link
Member Author

Choose a reason for hiding this comment

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

Aye, I will change it, this is where all readability goes away in my opinion. I can solve this by just not reading it again :)

@johnfn
Copy link
Member

johnfn commented Oct 1, 2016

Ideally we would refactor stuff to use Range now though...

@xconverge
Copy link
Member Author

Good to go I think

@johnfn
Copy link
Member

johnfn commented Oct 5, 2016

Thanks cubed, @xconverge!!!

@johnfn johnfn merged commit b193c22 into VSCodeVim:master Oct 5, 2016
This pull request was closed.
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