3 ms·
I'd be curious what the HN community thinks of a text editor plugin I've been considering. This wouldn't necessarily solve the problem described, but would miti
by ellius 9y ago
I'd be curious what the HN community thinks of a text editor plugin I've been considering. This wouldn't necessarily solve the problem described, but would mitigate it to some degree I think.
The idea is to write code in blocks. So you have a raw file with and the following operations:
INSERT (create a new block of text, either top-level or nested inside another)
DELETE (Selected block or all nested blocks)
UPDATE
Each block would effectively be a node consisting of its text, optionally split into a LEFT block of text and a RIGHT block. Each line would be stored along with a line number. Then when an insert or update occurred, all line numbers would be updated based on which lines were already to the left and right of the insert, at which point the file would re-render.
I think if you added tagging and selection / editing by tagging you'd get the benefits of something structured without getting down to the AST level or breaking all of the other useful add-ins built on the assumption that code will be text.