coteditor / CotEditor

Lightweight Plain-Text Editor for macOS
https://coteditor.com
Other
6.37k stars 431 forks source link

Consider adding support for big text files #704

Closed ethemcemozkan closed 2 years ago

ethemcemozkan commented 7 years ago

I think good text editor should open big(200+mb) text files.

1024jp commented 7 years ago

That's right. I should start thinking about this...

rushcheyo commented 6 years ago

@1024jp Have you thinked about it? I think 200+ MB is unnecessary, but the abilty to open 20 MB file is required for Olympiad Informatics. Do you use persistent data structure(such as std::rope in C++) to save text? Do you display the content partially?

ethemcemozkan commented 6 years ago

@1024jp Maybe you can add loading animation too while opening big files. It can help user by showing app is running normally

ethemcemozkan commented 6 years ago

@1024jp Do you have any plans about this issue?

1024jp commented 6 years ago

@ethemcemozkan The idea is good. However, it's actually pretty complicated. I suppose the major time-consuming process is not the file reading itself but UI drawing and layout calculation. And, therefore, I should be careful about adding animation, namely another drawing process.

Besides, CotEditor depends a lot on Apple's text handling system (TextKit), which is well-integrated with the macOS system but kind of black-box actually when you need to do advanced things, such as partial text display. I don't forget about this issue, but everything goes little by little.

oldcastlehq commented 5 years ago

CotEditor still struggles to open 20+ MB files. Any chance to fix that?

fieryo commented 5 years ago

I also wish to see big files support, but even with small (2-3MB) SQL files, CotEditor takes 97-100% CPU for minutes. The problem is "Syntax highlighting" option which is on by default. If I turn it off then opening is fine. I think that this option should automatically turn off for files > 1MB.

Just for comparison TextWrangler (which still runs on Mojave) opens the same SQL files instantaneously even with syntax highlighting.

1024jp commented 2 years ago

Hi, long time no see. But I have good news. Today I found the solution to reduce the time to syntax highlight drastically (ref. #1265). In addition, I also improve some other areas to reduce the time to open documents. In the next version, opening 20+ MB files becomes definitely easy, and 200+ MB files will also be able to open in a reasonable time (about 20-30 seconds on M1 Mac) without the rainbow cursor.

This change will be shipped with CotEditor 4.3.0, which will be released this summer.