[flagged]
Nerdy internals of an Apple text editor
11–20 of 93 posts
[deleted]
Re: Nerdy internals of an Apple text editor
#12Discussion for the first article: https://news.ycombinator.com/item?id=38866170
[deleted]
Re: Nerdy internals of an Apple text editor
#13Are the internals of other Mac-native text editors like TextMate similar to this as well?
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
#14The author did a great job using images to convey the various concerns each piece of code in the API is responsible for. Also super great detail in the writing. Nice work!
This feels like a technical-first article that also happens to generate goodwill for the product, as opposed to a marketing-first technical article that serves up the bare minimum of insights.
Re: Nerdy internals of an Apple text editor
#15I clicked "hide these widgets" from the three dot dropdown menu on your animations and now I can't figure out how to bring them back. heh.
Great post btw!
Re: Nerdy internals of an Apple text editor
#16I've been loving this app, It's replaced all other markdown apps for me including obsidian and ia Writer!
Re: Nerdy internals of an Apple text editor
#17This is great, I think it supplants https://www.objc.io/issues/5-ios7/getting-to-know-textkit/ as my go to introduction to TextKit.
Re: Nerdy internals of an Apple text editor
#18In the era of DOM documents (see notion, gitbook) I very often resort to attributed strings to do magic stuff with text parsing and manipulation. It’s such an elegant structure and I don’t understand why is so unknown.
Incredible article btw
Re: Nerdy internals of an Apple text editor
#19It's a real shame that Apple doesn't release the source to a recent version of TextEdit. Given its structure (more or less just a stock objects from the API) it would be super educational for anyone who wants to use NSTextView et al.
Re: Nerdy internals of an Apple text editor
#20This is amazing content marketing. Developers are an obvious target niche for such a product. Exposing internals of the software in a way HNers enjoy sounds like a great idea, would love to see if it worked as a traction experiment.