News for hackers. Stuff that matters.
Re:Nerdy internals of an Apple text editor by Someone on Tuesday March 05, 2024 @03:28PM (#39608777)
Depends on what you call “similar”. They’ll have storage, layout, a part of the layout that’s visible, etc, but they may not separate them that clearly, and won’t have that rich an API. TextView is way more flexible than what the typical _text_ editor needs. Text editors typically don’t need multiple fonts, multiple font sizes, varying line spacing, paragraph indents, proportional fonts, right-aligning or decimal tabs, images inside text, etc.

All those features make TextView relatively slow and memory hungry. Because of that, I don’t think _text_ editors that handle multi-megabyte files will use a single NSAttributedString to store the entire document’s text.

Re:Nerdy internals of an Apple text editor by papereditor on Tuesday March 05, 2024 @05:19PM (#39609890)
Yep. TextView is a beast.

For multi-megabyte files I always use Sublime.

Re:Nerdy internals of an Apple text editor by kccqzy on Tuesday March 05, 2024 @06:31PM (#39610444)
And for multi-gigabyte files I use HexFiend.
Re:Nerdy internals of an Apple text editor by KerrAvon on Tuesday March 05, 2024 @09:29PM (#39611568)
BBEdit is more Mac-like than Sublime and handles multi-gig files with ease.
Re:Nerdy internals of an Apple text editor by papereditor on Wednesday March 06, 2024 @04:29AM (#39614029)
Indeed, there are a handful of those dev-oriented editors that crunch through mega files with ease. No idea why I prefer Sublime. :D