Skip to content

Commit

Permalink
Add (provisional) EventListener with update_on_save option
Browse files Browse the repository at this point in the history
  • Loading branch information
bordaigorl committed Mar 11, 2014
1 parent a08b93c commit c5c70d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ The following settings can be customised:
`created`, `updated`, `relevance`, `update_sequence_number`, `title`.
Set the `notes_order_ascending` setting to `true` to reverse the selected order.
* `max_notes`: maximum number of notes in a panel; default is 100.
* `update_on_save`: when this setting is true, saving a file containing a note will also update (overwriting it) the online version. Default is false.


# Acknowledgements
Expand Down
9 changes: 9 additions & 0 deletions sublime_evernote.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,12 @@ def run(self):
EvernoteDo._noteStore = None
EvernoteDo._notebooks = None
self.connect(lambda: True)


class EvernoteListener(sublime_plugin.EventListener):

settings = sublime.load_settings(EVERNOTE_SETTINGS)

def on_post_save(self, view):
if self.settings.get('update_on_save'):
view.run_command("save_evernote_note")

0 comments on commit c5c70d7

Please sign in to comment.