Sublime Forum

Plugin Api: on_modified should receive diffs

#1

Plugins could be made a lot faster if they new what changed in a file. For instance, if I have a plugin that needs to process parts of a file, I can cache that. But if the text changes, I need to reparse the text. Right now, I cannot tell what changed, so I have to reparse everything. If a plugin could hook an event that passes in like insert, 5, 10 to say the user inserted 5 character at character 10 for instance, then rather than reparsing the whole document, I could do just that line. Heck, even just saying what line were modified would be good enough. I dunno, I think a lot of plugins could be better and faster with that, (although more complex as well).

0 Likes

#2

Jon said a while ago that this wouldn’t happen until version 3:


On the other hand, he said the same thing about code folding! So… fingers crossed!

See also this: Redo inside of edit crashes sublime

0 Likes

#3

Interesting, yea, it just bugs me when I see stuff that could be so much faster, but isn’t.

0 Likes