Skip to content

Commit

Permalink
fix archive folder not showing in index.
Browse files Browse the repository at this point in the history
fix project root path in index.
  • Loading branch information
fk128 committed Jul 24, 2015
1 parent c484ec7 commit 5bfa365
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion notes_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5bfa365

Please sign in to comment.