Skip to content

Column selection type#351

Merged
pokey merged 6 commits intomainfrom
column_selectionType
Dec 2, 2021
Merged

Column selection type#351
pokey merged 6 commits intomainfrom
column_selectionType

Conversation

@AndreasArvidsson
Copy link
Copy Markdown
Member

@AndreasArvidsson AndreasArvidsson commented Dec 2, 2021

Selection type to create multiple selections in a column between two targets instead of a continuous range

Right now doesn't do anything without a ranged target.

fixes #345

Copy link
Copy Markdown
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

This is super cool! Left a few minor comments but otherwise looks good

Comment thread src/processTargets/index.ts Outdated
Comment thread src/processTargets/index.ts Outdated
Comment thread src/processTargets/index.ts Outdated
Copy link
Copy Markdown
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Good stuff!

const delta = isForward ? 1 : -1;
const results: TypedSelection[] = [];

for (let i = anchorLine; true; i += delta) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This would be a bit cleaner imo with a loadash range + map but not worth rewriting; maybe something to play with next time

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I must admit that I'm not a big fan of lodash. But you're probably right in this case and I did think about it.

@pokey pokey merged commit 0c394d7 into main Dec 2, 2021
@pokey pokey deleted the column_selectionType branch December 2, 2021 12:55
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.

Modifier that allows you to put cursor on column in every row between two targets

2 participants