Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Select screen rows when click-dragging in gutter - #8377

Merged
nathansobo merged 2 commits into
masterfrom
ns-select-screen-lines-from-gutter
Aug 19, 2015
Merged

nathansobo merged 2 commits into
masterfrom
ns-select-screen-lines-from-gutter

Conversation

@nathansobo

Copy link
Copy Markdown
Contributor

/cc @izuzak for 🔬

Before:

gutter-selection-before

After:

gutter-selection-after

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

Nice! 💎

@izuzak

izuzak commented Aug 14, 2015

Copy link
Copy Markdown
Contributor

Thanks for the ping, @nathansobo! Yeah, this is how things were before, but we intentionally switched to buffer rows in #5814 (which was a fix for #5738).

I'm not strongly against this change, but just wanted to mention that I personally find it more intuitive if buffer rows are selected when you click in the gutter, and that's also the behavior in Sublime (as far as I can tell by reading my previous comments on this topic). I'm on a brand new laptop this week so don't have all the other editors installed -- would be great if someone could see how some other editors behave. And would be nice to hear from other folks what's more intuitive for them.

@mehcode

mehcode commented Aug 14, 2015

Copy link
Copy Markdown
Contributor

Sublime
When you click on a line number, it selects the buffer row.

When you click and drag to select text, it only highlights whole buffer rows on the line number gutter but it selects one screen row of text at a time when dragging up.


If we could mimic Sublime here I think we could solve both use cases nicely (smooth drag-to-select and click to select line).

@izuzak

izuzak commented Aug 14, 2015

Copy link
Copy Markdown
Contributor

Thanks for double-checking, @mehcode ❤️ -- yeah, I'd be 👍 on that approach.

@nathansobo

Copy link
Copy Markdown
Contributor Author

@lee-dohm In #8350 (comment) other issue you said this:

I would suggest using screen lines in the case of soft wrap, but in the case of folding, it should use buffer lines.

Can you expand a bit on this and get more specific about the behavior you'd prefer?

@lee-dohm

Copy link
Copy Markdown
Contributor

Absolutely, sorry I wasn't clear in the first place ...

If I click here:

napkin 08-14-15 9 23 08 am

I would expect it to only select from Status] through the end of that screen line. But if I go to a folded section of code and click here:

napkin 08-14-15 9 25 29 am

I would expect it to select the entire folded section in the buffer, not just the screen line. In other words, I would expect it to select the entire loadOrCreate function.

@nathansobo

Copy link
Copy Markdown
Contributor Author

I've updated the PR to select the initially clicked buffer row, but then select screen rows on drag. It feels smooth but still intuitive on the initial click.

select-by-buffer-then-screen

@nathansobo
nathansobo force-pushed the ns-select-screen-lines-from-gutter branch from 0ab0315 to 31bdd56 Compare August 19, 2015 18:46
@izuzak

izuzak commented Aug 19, 2015

Copy link
Copy Markdown
Contributor

Just took this for a test drive and it feels great. ⚡ again @nathansobo

nathansobo pushed a commit that referenced this pull request Aug 19, 2015
Select screen rows when click-dragging in gutter
@nathansobo
nathansobo merged commit 55a0be9 into master Aug 19, 2015
@nathansobo
nathansobo deleted the ns-select-screen-lines-from-gutter branch August 19, 2015 20:15
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.

5 participants