Sublime Forum

Prevent save file for custom behavior

#1

hello plugin developers,

i want write plugin for some hosting service, where i can edit my file in browser, but i want to do it in ST2. I write first preparations to load this file from server, open new window and insert the source code.

is it possible to do:

  1. prevent save file (ctrl+s) and handle this event to do custom save operations (send file to server). How can i do it without saving file on disk?

  2. i also need something like view.set_dirty(false) after send file to server

  3. have the ST2 some function to identify and set syntax by filename, something like:

view.set_syntax_by_file_name("path/to/file.py")

thx

1 Like