3 ms·
Does anything implement it like that?
by kzrdude 5y ago
Does anything implement it like that?
- nly 5y agoWouldn't mind betting Sublime does a good job
- OneLeggedCat 5y agoIt does. I loaded a 14GB file in it once.
- _hl_ 5y agoxi-editor has some reasonably sophisticated handling for large files
- mftb 5y agoIt's vaguely reminiscent of Vim's implementation, in the sense that I think, for large files, in it's default config, Vim keeps most of the text in it's swap file and pages it in as needed. Vim's implementation also feels somewhat line-oriented in that if you load a large JSON file that has everything on 1 line and you try to edit that line, uh... it will be sluggish, but if you do, like %!jq '.' and format it, you can them move around the file a little easier. Edit - What the heck while I'm at it: Emacs - Historically used a Gap-Buffer which optimized more for locality of edits than loading large files. It doesn't suffer though as much from heap fragmentation though as the linked-list of strings type approach. Monaco - The editor in VS Code recently went from a linked-list of strings to a PieceTree buffer. Which basically loads a the whole file into an immutable buffer and then uses the PieceTree to manage the edits. Others - Lately people keep talking about Ropes, which is another tree type deal with extra-smarts specifically for text editing. I don't know of a game-changing editor like the others mentioned that uses it tho.
- jll29 5y agoRopes were introduced in this paper in the journal Software, Pracise and Experience: https://doi.org/10.1002/spe.4380251203 https://doi.org/10.1002/spe.4380251203 (best accessed from a university domain) An example for an editor that uses them to manage large text files is Xi-Editor: https://github.com/xi-editor/xi-editor https://github.com/xi-editor/xi-editor (edit: written in Rust).
- mftb 5y agoCool, I'm really interested in that paper, ty.
- compressedgas 5y agohttps://www.chiark.greenend.org.uk/~sgtatham/tweak/ https://www.chiark.greenend.org.uk/~sgtatham/tweak/