Skip to content
This repository has been archived by the owner on May 17, 2018. It is now read-only.

Commit

Permalink
Merge pull request #377 from szastupov/remember_parser
Browse files Browse the repository at this point in the history
Remember last selected parser
  • Loading branch information
Julien Bouquillon authored May 8, 2017
2 parents 3e89a8c + 64915b9 commit 5e179c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion MarkdownPreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,8 @@ def parser_specific_convert(self, markdown_text):


class MarkdownPreviewSelectCommand(sublime_plugin.TextCommand):
selected = 0

def run(self, edit, target='browser'):

settings = sublime.load_settings("MarkdownPreview.sublime-settings")
Expand Down Expand Up @@ -1161,10 +1163,13 @@ def run(self, edit, target='browser'):
}
)
else:
window.show_quick_panel(self.user_parsers, self.run_command)
window.show_quick_panel(
self.user_parsers, self.run_command, 0, self.selected
)

def run_command(self, value):
if value > -1:
self.selected = value
self.view.run_command(
"markdown_preview",
{
Expand Down

0 comments on commit 5e179c3

Please sign in to comment.