atom / find-and-replace

Find and replace in a single buffer and in the project
MIT License
242 stars 219 forks source link

Multi-selecting many instances of a selecting causes slowdown and stall #692

Open manfrin opened 8 years ago

manfrin commented 8 years ago

Prerequisites

For more information on how to write a good bug report or enhancement request, see the CONTRIBUTING guide.

Description

Multi-select on a large file with many matches starts to crawl and then crash after trying to select many.

I had built a csv from some output and realized I formatted the newline wrong. The file wasn't super huge (64kb), so I figured I would just select all and replace instead of regenerating. I couldn't think of the select-all command off the top of my head, so I selected the first \n and then held down CTRL+D -- figuring it would just take 10 seconds to select through (I know -- kinda silly when a feature is built to do what I was trying to do, but I thought just selecting this way would be quicker than looking up the right way).

However, just a few seconds in, Atom began to crawl, and then it just stopped responding. Cursor was stuck, atom didnt respond to any commands, and I had to force quit out.

I was able to reproduce it easily, and I made a small example file that I confirmed replicates the issue.

I'm on Atom 1.6.0, and I realize there's 1.6.1 out -- but I did not see any recently closed issues that addressed things related to this. I also could not find any other issue that referenced this (but I did find a few that might benefit from my sample file: https://github.com/atom/find-and-replace/issues/603, https://github.com/atom/find-and-replace/issues/655).

I am on OS X El Capitain on a beefy MBP, so I don't think the available RAM/resources is at issue (although I do have vagrant running and a few servers).

Steps to Reproduce

  1. Open provided sample file.
  2. Select something that is repeated (I was selecting \n).
  3. Hold down CTRL+D

Expected behavior: Atom selects the next instance rapidly as the command is held down, until the end.

Actual behavior: Rapidly selected for a few seconds and then began to crawl and quickly stalled.

Versions

1.6.0, 1.6.1, OSX El Capitain.

sample.txt

(I had to rename the file to .txt for github upload -- issue still occurs with that extension)

lee-dohm commented 8 years ago

In step 3 do you mean Cmd+D, find-and-replace:select-next?

lee-dohm commented 8 years ago

This is also probably related to https://github.com/atom/atom/issues/10153

manfrin commented 8 years ago

Yep, find-and-replace:select-next. The related issue does look similar (I didn't know if I should file this here or at atom/atom).

lee-dohm commented 8 years ago

You filed in the correct place :grinning:

I just suspect that we'll need to handle key repeated commands in a general way and wanted to link the two Issues together.

ssebbass commented 8 years ago

Same issue, multi-line editing more than 10 lines it's almost impossible.