Events
Is there a way to Detect changes to a buffer? The lua api doesn't seem to include any events related to that except from detecting single key inputs in insert or replace mode. This really blocks me from making some plugins. I have created a parinfer plugin (that doesn't balance parens if you try to delete them), and also it is not possible to use the rust-parinfer
combining vis.events.WIN_HIGHLIGHT vis.win.file.modified seems to do the trick of detecting changes on a buffer
If someone is interested, I have manage to wrap parinfer-rust to create a vis-parinfer plugin. Now vis has structural editing :)
Hi, you can link to plugins in the Wiki Plugins page
As soon as it is stable. It seems that subscribing to WIN_HIGHLIGHT event turns syntax highlight off until the file is saved. Is that how it supposed to work?
Seems that updating text line per line thought the highlight event halts highlighting More specifically this happens when i get a response text from parinfer and then update the lines that have changed: for s in response["text"]:gmatch("([^\n]*)\n?") do if old_lines[n]~=s then old_lines[n]=s end n=n+1 end A work around was to trigger the highlight event a second time.