Skip to content

Commit

Permalink
fix #31
Browse files Browse the repository at this point in the history
  • Loading branch information
Fahdi Kanavati committed May 25, 2016
1 parent 23229dd commit ad1d73e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ def run(self, file_path):
def async_open(self, file_path):
view = sublime.active_window().open_file(file_path, sublime.ENCODED_POSITION)
f_id = file_id(file_path)
if db.get(f_id) and os.path.isfile(db[f_id]["color_scheme"]):
view.settings().set("is_note", True)
if db.get(f_id):
view.settings().set("color_scheme", db[f_id]["color_scheme"])
view.settings().set("is_note", True)


class NotesNewCommand(sublime_plugin.ApplicationCommand):
Expand Down Expand Up @@ -230,7 +230,8 @@ def on_highlight(self, index):
self.window.active_view().settings().set("color_scheme", path)

def is_enabled(self):
return self.window.active_view().settings().get("syntax").endswith("Note.tmLanguage")
syntax = self.window.active_view().settings().get("syntax")
return syntax.endswith("Note.tmLanguage") or syntax.endswith("Note.sublime-syntax")


class NoteArchiveCommand(sublime_plugin.WindowCommand):
Expand Down

0 comments on commit ad1d73e

Please sign in to comment.