Live data from Hacker News

A glance into web tech-based text editors’ text management

ecc-comp.blogspot.com

11–20 of 22 posts

Re: A glance into web tech-based text editors’ text management

#12
I wish this article had also discussed DraftJS and QuillJS, which both use much more involved text management logic. Draft is powered by Immutable.js ( https://facebook.github.io/immutable-js/ ) and Quill is powered by Parchment ( https://github.com/quilljs/parchment ).

I've been creating a hobby text editor for myself and have tried almost every text editor library on the planet, I think Draft and Quill are the best.

Re: A glance into web tech-based text editors’ text management

#14
post #13

Total noob here but laughed at FARTF05 in assembly code. Would like if i got to code up FARTS in my daily job. What does that code do?

It's a label you can jump to. I guess FARTF stands for the function name: FcAppendRgchToFn. Then the number is used to differentiate each label.

Re: A glance into web tech-based text editors’ text management

#16

"There is a huge opportunity here to contribute to Atom and make it way better than it already is. Write a piece chain text buffer implementation. Write a gap buffer implementation. Anything but using a regular array like this." Is it really that easy? Why aren't they using those data structures already?

Because it doesn't matter with modern day CPUs with typical file sizes and typing speeds.

Worst case scenario for a plain array is if you insert to the front of the array where it has to shift everything down one. But even if the file is on the order of several megabytes, this will still finish in milliseconds at most and the typist won't notice it.

Re: A glance into web tech-based text editors’ text management

#17

"There is a huge opportunity here to contribute to Atom and make it way better than it already is. Write a piece chain text buffer implementation. Write a gap buffer implementation. Anything but using a regular array like this." Is it really that easy? Why aren't they using those data structures already?

I'd imagine that only having a partial buffer available makes it really hard to do text highlighting, auto completion, linting, etc.

Re: A glance into web tech-based text editors’ text management

#20
post #16

"There is a huge opportunity here to contribute to Atom and make it way better than it already is. Write a piece chain text buffer implementation. Write a gap buffer implementation. Anything but using a regular array like this." Is it really that easy? Why aren't they using those data structures already?

Because it doesn't matter with modern day CPUs with typical file sizes and typing speeds. Worst case scenario for a plain array is if you insert to the front of the array where it has to shift everything down one. But even if the file is on the order of several megabytes, this will still finish in milliseconds at most and the typist won't notice it.

What a waste of fossil fuel energy!

What a waste of laptop battery!

It can be really hard to make software efficient, sometimes there are easy wins.. seems odd to not just do it.

An insert or delete from (e.g.) a rope is very cheap and as they are immutable can make some other features very easy... saves copying megabytes...

Post reply on HN