focus-editor / focus

A simple and fast text editor
GNU General Public License v3.0
1.82k stars 99 forks source link

Focus freezes for several seconds when trying to search in a big single-line file #330

Open fbjerno opened 8 months ago

fbjerno commented 8 months ago

Describe the bug Searching (CTRL-F) is very slow on big single-line files. Formatting the file so the text is not all on the same file makes the issue go away.

To Reproduce

  1. Open/create a big file with all the text on one line. (I've attached the file I experienced this problem with, along with a formatted version that does not cause the same issue)
  2. Open the search dialogue and attempt to search something.
  3. Focus immediately becomes unresponsive after the first key press and takes several seconds to become responsive again.

Expected behavior Searching should be about as fast on a file where the text is all on the same line as one with multiple lines.

focus-editor commented 8 months ago

We don't really target this use case with all text on one line. This is a tradeoff we're making at least for now.

On Sun, Mar 31, 2024, 7:04 AM fbjerno @.***> wrote:

Describe the bug Searching (CTRL-F) is very slow on big single-line files. Formatting the file so it is not all on the same file makes the issue go away.

To Reproduce

  1. Open/create a big file with all the text on one line. (I've attached the file I experienced this problem with, along with a formatted version that does not cause the same issue)
  2. Open the search dialogue and attempt to search something.
  3. Focus immediately becomes unresponsive after the first key press and takes several seconds to become responsive again.

Expected behavior Searching be about as fast on a file where the text is all on the same line as one with multiple lines.

— Reply to this email directly, view it on GitHub https://github.com/focus-editor/focus/issues/330, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4OX77UO34AVKWNUGRE6J4TY23WCVAVCNFSM6AAAAABFPXFXNWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTMNRQGY4TINY . You are receiving this because you are subscribed to this thread.Message ID: @.***>