sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
808 stars 39 forks source link

change indent on large lines or join large number of lines makes the application hang #2317

Open WesternGun opened 6 years ago

WesternGun commented 6 years ago

Summary

Operations to very long lines hangs the application forever.

Expected behavior

Actual behavior

Steps to reproduce

  1. Download the test file cherry.zip and extract to get a cherry.svg.
  2. Open the file with Sublime Text 3.1.1 build 3176, the latest
  3. Select the file from line 6 to 36393
  4. Open "Find and Replace", enable regex search, "in selection", and replace "\n" with "". You see "36402 match" in the status bar.
  5. Click "Replace all". It will hang the application forever. I waited till 200 seconds and have to close the application.
  6. Open the same file with Notepad++, do the same operation and I got the result in 10 seconds.
  7. Now, place the cursor at the beginning of this line in Notepad++, and press tab to change indent. It gets done in 5 seconds.
  8. Save the file, reopen it in ST3. Press tab. It hangs forever.

Environment

keith-hall commented 6 years ago

possible duplicate of https://github.com/SublimeTextIssues/Core/issues/358 also related: https://github.com/SublimeTextIssues/Core/issues/1538 and https://github.com/SublimeTextIssues/Core/issues/1968

WesternGun commented 6 years ago

Hi @keith-hall, I think #358 may not be relevant because the file is small, but #1538 and #1968 are definitely related. It may be caused by a line buffer problem?

brtwrst commented 6 years ago

Sublime 3176

Ran into this last week with a file of only 600kb The file has only one very long line. When i try to split the line at the semicolons (into ~18000 lines) Sublime just hangs for around 2 minutes before completing. Joining the lines together again takes the same amount of time. See also: https://forum.sublimetext.com/t/replace-all-is-very-slow-when-working-on-very-long-single-lines/37812

oconnor0 commented 4 years ago

I have run into a similar issue here with Sublime Text 4074.

I open https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts in a local file.

Select All Split into Lines Home Type # And wait for a few minutes for things to resolve, during which Sublime Text grays out, and stops responding. Pressing Undo after the edits causes a similar hang.