I’m writing a integration plugin for a commercial version control system, it works in a ‘lock(checkout)-modify-unlock(checkin)’ paradigm, what the plugin will do:
- when user start editing a file, pop a dialog to ask if he/she likes to checkout the file.
- if user choose ‘yes’, then the file is checked-out automatically.
- if user choose ‘no’, nothing happens and the content of the file should be untouched.
The hard part is NO.3, where Sublime Text API only documented a ‘on_modified’ event callback, when user choose ‘no’ the buffer is already modified and I can’t find a way to revert the content back.
Is there any un-documented API like ‘on_pre_modify’?
Regards!