Live data from Hacker News

Nerdy internals of an Apple text editor

papereditor.app

81–90 of 93 posts

Re: Nerdy internals of an Apple text editor

#81

Earlier quoted context omitted.

Yep. TextView is a beast. For multi-megabyte files I always use Sublime.

BBEdit is more Mac-like than Sublime and handles multi-gig files with ease.

Indeed, there are a handful of those dev-oriented editors that crunch through mega files with ease. No idea why I prefer Sublime. :D

Re: Nerdy internals of an Apple text editor

#83

Earlier quoted context omitted.

Last time ( https://news.ycombinator.com/item?id=38866170 ) there was a small spike in sales, but no lasting effect. I would not say that developers are the target niche. The best customers are professional writers who use a ton of writing apps for different occasions.

Professional writer who uses different writing apps for different occasions is me exactly. I’m also the (or at least a) guy who messaged you about inline comments. As soon as all the details of that feature are implemented, I’m buying it.

Nice!

I'll be sure to prioritize this work then. :D

Re: Nerdy internals of an Apple text editor

#84
post #48
post #5

Are the internals of other Mac-native text editors like TextMate similar to this as well?

https://github.com/MarkEdit-app/MarkEdit/wiki/Why-MarkEdit The MarkEdit team uses WebView and have strong opinions about why.

Using CodeMirror in a desktop app seems like an interesting choice. I'd love to hear more about why they took this approach.

Re: Nerdy internals of an Apple text editor

#86
post #84
post #48

Earlier quoted context omitted.

https://github.com/MarkEdit-app/MarkEdit/wiki/Why-MarkEdit The MarkEdit team uses WebView and have strong opinions about why.

Using CodeMirror in a desktop app seems like an interesting choice. I'd love to hear more about why they took this approach.

Web tech is an obvious pragmatic choice. Cross-platform by default, amazing libraries with great support.

The average user does not care.

Re: Nerdy internals of an Apple text editor

#87

This is great, I think it supplants https://www.objc.io/issues/5-ios7/getting-to-know-textkit/ as my go to introduction to TextKit.

For iOS 15.0 or later/MacOS Monterey or later, you want to look at TextKit 2. See https://developer.apple.com/documentation/appkit/textkit/usi...

That’s a new layout engine that currently is the default for text fields and on iOS and MacOS, but likely will be the only option some time in the future.

Re: Nerdy internals of an Apple text editor

#88
post #87

This is great, I think it supplants https://www.objc.io/issues/5-ios7/getting-to-know-textkit/ as my go to introduction to TextKit.

For iOS 15.0 or later/MacOS Monterey or later, you want to look at TextKit 2. See https://developer.apple.com/documentation/appkit/textkit/usi... That’s a new layout engine that currently is the default for text fields and on iOS and MacOS, but likely will be the only option some time in the future.

Indeed!

I want to migrate Paper to it this or next year.

Re: Nerdy internals of an Apple text editor

#89
post #18

In 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

Do you have an example? I’d love to learn more!

Let’s say you have a rich text where you want to highlight all occurrences of some token or syntax. When you have tree data structures you cannot use regexps or a simple parsers, since the full text may be split in different nodes.

With attributes strings it’s trivial, you just need to move attributes accordingly and to normalize stuff at the end.

Re: Nerdy internals of an Apple text editor

#90
post #18

In 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

I wonder if there are any web rich text editor components that use attributed strings? Tired of the DOM.
Post reply on HN