Skip to content
This repository was archived by the owner on Apr 6, 2018. It is now read-only.

Conversation

pthrasher
Copy link

This is a work-in-progress. I'm hoping to get some feedback / collaboration.

This is just my first pass at getting blockwise selection to work.

This implementation fails when down-arrowing into an empty line, and also, currently there's not a simple way to track the cursor when moving up and down since atom doesn't let you put the cursor places where there's no text (afaik).
#645
#468

atom/atom#2306

@bronson
Copy link
Contributor

bronson commented May 24, 2015

Just curious, doesn't it make sense for Atom core to implement blockwise selection first? It looks like your technique will handle the text pretty well all on its own, but the visual appearance will be pretty difficult to get right. (pure speculation, tell me if I'm wrong).

That said, since blockwise select isn't on Atom's 1.0 punchlist (!!), maybe it does make sense just to do it here. It's an absolute requriement for any serious text editor.

@pthrasher
Copy link
Author

@bronson Yes, it does. First, atom/text-buffer will need to support out-of-bounds selections. (beyond line endings)

After that, it should be easy to add the visual changes to atom proper. I opened an issue to begin discussing this a while back, but haven't heard anything. (atom/text-buffer#59)

I've been swamped, and haven't come back to this, but I will hopefully clean up this version and fix some kinks this week. I think having something in place is a good first start. After that, perhaps I can take a whack at adding out-of-bounds support to text-buffer and see what people think.

@maxbrunsfeld
Copy link
Contributor

currently there's not a simple way to track the cursor when moving up and down.

@pthrasher cursors have the notion of a 'goal column', similar to other text editors, such that when you move the cursor vertically from a long line onto a shorter one and back again, it will return to the original column. You shouldn't have to do anything special to make this work; the normal cursor movement commands should take care of it.

EDIT: I think calling TextEditor::setSelectedBufferRanges clears and recreates the selections, which causes the goal column information to be lost. Thinking about what to do about this...

@bronson
Copy link
Contributor

bronson commented Jul 4, 2015

There's this too: https://atom.io/packages/vim-mode-visual-block

No yank or paste yet.

@lee-dohm
Copy link
Contributor

lee-dohm commented Apr 5, 2018

As stated in the README, this package is no longer maintained and is deprecated. We recommend that people use the vim-mode-plus package instead. Because of this, we are archiving this repository and closing all issues and pull requests. Thanks very much for your support and contributions!

@lee-dohm lee-dohm closed this Apr 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants