bigfive / atom-sublime-select

Enable 'sublime style' multiline selection boxes to Atom editor http://atom.io
MIT License
233 stars 49 forks source link

Selection of the end of lines #107

Closed signalwerk closed 7 years ago

signalwerk commented 8 years ago

If I'm at the end of a line and I try to select all the line endings I can do in Sublime Text the following:

sublime

But with this extension it feels broken:

atom

Is that e regression? Hmm... not sure...

105 is somehow related but not the same. #105 would be a step after this I guess.

morbius1st commented 8 years ago

I have the same issue.
Version: 1.6.0 Atom: 1.8.0

Ingramz commented 8 years ago

It used to work before #93 was merged.

pratyushtewari commented 8 years ago

Seems like a regression. It used to work before.

jayveeee commented 8 years ago

I have the same issue. Version: 1.7.2 OS: Windows Atom: 1.9.8

As mentioned by Ingramz, it worked before version 1.6.0

jarednipper commented 8 years ago

A quick workaround is to comment out editor-handler.coffee line 120. (if rowLength > @mouseStartPos.column or rowLength > @mouseEndPos.column)

https://github.com/bigfive/atom-sublime-select/blob/master/lib/editor-handler.coffee#L120

I haven't experienced any side effects yet.

jeromegrosse commented 7 years ago

I've been using the 'fix' mentioned by @jarednipper and I confirm that it fixes the issue.

elijahgagne commented 7 years ago

I'm also seeing this problem with: Version: 1.7.2 OS: Windows Atom: 1.12.5

I'm not having luck with jarednipper's workaround. If I comment out just line 120, the package fails to load. If I comment out lines 120-122, column mode no longer works at all.

simplesteph commented 7 years ago

@jarednipper can you please do a PR so we can all benefit from it?

jarednipper commented 7 years ago

@simplesteph I don't know enough about this project to know what this hack breaks. Also, a Windows user reported that it didn't help.

bigfive commented 7 years ago

Yep definite bug. Thanks for the reports everyone. I'll fix this one in the next release

aaranmcguire commented 7 years ago

So, I've just attempted @jarednipper's fix and found some undesired behaviour:

Before:

        for row in [@mouseStartPos.row..@mouseEndPos.row]
          @mouseEndPos.column = 0 if @mouseEndPos.column < 0
          rowLength = @editor.lineTextForScreenRow(row).length
          if rowLength > @mouseStartPos.column or rowLength > @mouseEndPos.column
            range = [[row, @mouseStartPos.column], [row, @mouseEndPos.column]]
            ranges.push range

After:

        for row in [@mouseStartPos.row..@mouseEndPos.row]
          @mouseEndPos.column = 0 if @mouseEndPos.column < 0
          rowLength = @editor.lineTextForScreenRow(row).length
          # if rowLength > @mouseStartPos.column or rowLength > @mouseEndPos.column
          range = [[row, @mouseStartPos.column], [row, @mouseEndPos.column]]
          ranges.push range

I've found this causes highlighting of lines that should not be selected (easier to show than explain).

Before (Notice Line 6 + 8 are not selected):

screen shot 2017-03-12 at 10 04 12

After (Notice Line 6 + 8 are selected):

screen shot 2017-03-12 at 10 02 15

And for reference, here's a screenshot from Sublime Text:

screen shot 2017-03-12 at 10 02 38

Hope this helps.

bigfive commented 7 years ago

Hey everyone. Ive just released a patch for this. Please let me know how you go.

aaranmcguire commented 7 years ago

I guess its fixed in that you no longer need to do the workaround, but you still have the issue I mentioned above. - It won't affect many people, but it would be a nice feature to maintain.