News for hackers. Stuff that matters.
Re:A glance into web tech-based text editors’ text management by tbirdz on Friday November 11, 2016 @01:56AM (#12928581)
If you are interested in this kind of stuff, Craig Finseth's The Craft of Text Editing is a great read: https://www.finseth.com/craft/
Re:A glance into web tech-based text editors’ text management by gbrown_ on Friday November 11, 2016 @05:11AM (#12929368)
That will make a good weekend read thanks! Others may be interested in Data Structures for Text Sequences by Charles Crowley[0] which describes Piece Tables. This is the basis for the Vis editor[1].

[0]https://www.cs.unm.edu/~crowley/papers/sds.pdf

[1]https://github.com/martanne/vis

Re:A glance into web tech-based text editors’ text management by jc4p on Friday November 11, 2016 @11:16AM (#12931966)
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 by lpasselin on Friday November 11, 2016 @10:31AM (#12931454)
"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?

Re:A glance into web tech-based text editors’ text management by rawnlq on Friday November 11, 2016 @11:59AM (#12932354)
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 by time4tea on Friday November 11, 2016 @01:04PM (#12932802)
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...

Re:A glance into web tech-based text editors’ text management by saosebastiao on Friday November 11, 2016 @12:10PM (#12932446)
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 by williamstein on Friday November 11, 2016 @10:52AM (#12931707)
Key takeaway from the article: "One thing I'm taking away from this is if I ever need a web-based source code editor, hands down I'm going with CodeMirror."
Re:A glance into web tech-based text editors’ text management by chill_t on Friday November 11, 2016 @11:36AM (#12932156)
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?
Re:A glance into web tech-based text editors’ text management by tbirdz on Friday November 11, 2016 @11:43AM (#12932209)
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 by saosebastiao on Friday November 11, 2016 @01:31PM (#12932994)
I long for the day that Microsoft starts transitioning to C# on .NET Core for vscode. They made the right choice using typescript on the electron platform, but the difference in efficiency between C# and js is night and day. I've heard it's in the long term plans, but how that'll work I have no clue.
Re:A glance into web tech-based text editors’ text management by DennisP on Friday November 11, 2016 @12:35PM (#12932611)
According to this, early versions of MS Word used a piece table: http://1017.songtrellisopml.com/whatsBeenWroughtUsingPieceTa...
Re:A glance into web tech-based text editors’ text management by cygned on Friday November 11, 2016 @12:46AM (#12928295)
Neat article and interesting to see some source code.

Too bad, blogspot on mobile is a pain in the butt.

Re:A glance into web tech-based text editors’ text management by z3t4 on Friday November 11, 2016 @12:58PM (#12932766)
For those wondering why the heck you would make a web based text editor: browsers are actually very good at displaying text, and javascript is good at handling text.
Re:A glance into web tech-based text editors’ text management by ainiriand on Friday November 11, 2016 @10:16AM (#12931334)
Good article, and a really cool blog. Try to set it up for mobile also. Thank you.
Re:A glance into web tech-based text editors’ text management by fallat on Saturday November 12, 2016 @03:08AM (#12937075)
What is particularly wrong with mobile? The only thing seems to be the GitHub Gist pastes.
Re:A glance into web tech-based text editors’ text management by roryisok on Friday November 11, 2016 @01:50AM (#12928552)
That headline hurts my brain. Awful start. Why not "how web based text editors manage their text" or "a glance at the text management of web based text editors"
Re:A glance into web tech-based text editors’ text management by roryisok on Friday November 11, 2016 @05:56AM (#12929588)
yay! I'm helping! (the original headline was the same as the article title "A Glance Into Web Tech.-Based Text Editors' Text Management")
Re:A glance into web tech-based text editors’ text management by laurent123456 on Friday November 11, 2016 @07:41AM (#12930083)
The new title is not accurate though, since those editors are not "web-based", but indeed "web tech-based" (based on Chrome), or perhaps simply "HTML/JS-based".
Re:A glance into web tech-based text editors’ text management by pimlottc on Friday November 11, 2016 @11:43AM (#12932210)
I gave up reading it after my sixth sheep got sick.