From 5bfa3655b49444ac8d8306fc94dea5576c9fe716 Mon Sep 17 00:00:00 2001 From: fk128 Date: Fri, 24 Jul 2015 12:51:19 +0100 Subject: [PATCH] fix archive folder not showing in index. fix project root path in index. --- notes_index.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/notes_index.py b/notes_index.py index e3aad75..1689fcc 100644 --- a/notes_index.py +++ b/notes_index.py @@ -12,7 +12,11 @@ def settings(): def get_root(): - return os.path.normpath(os.path.expanduser(settings().get("root"))) + project_settings = sublime.active_window().active_view().settings().get('PlainNotes') + if project_settings: + return os.path.normpath(os.path.expanduser(project_settings.get('root',settings().get("root")))) + else: + return os.path.normpath(os.path.expanduser(settings().get("root"))) class NotesBufferCommand(sublime_plugin.WindowCommand): @@ -49,6 +53,9 @@ def list_files(self, path): if not relpath.startswith("."): line_str = u'{0}▣ {1}'.format(indent, os.path.relpath(root, path)) lines.append((line_str, root)) + if relpath.startswith(settings().get("archive_dir")): + line_str = u'{0}▣ {1}'.format(indent, 'Archive') + lines.append((line_str, root)) if not relpath.startswith(".brain"): subindent = ' ' * TAB_SIZE * (level + 1) for f in files: