refocus to the md view when creating preview

This commit is contained in:
math2001
2016-11-25 08:29:23 +11:00
parent 349d5e314a
commit 35e53cb683
2 changed files with 7 additions and 3 deletions

View File

@ -49,10 +49,13 @@ class MarkdownInPopupCommand(sublime_plugin.EventListener):
html += markdown2.markdown(self.get_view_content(current_view))
view_id = current_view_settings.get('markdown_preview_id', None)
def create_preview_panel():
focus_group, focus_view = w.get_view_index(current_view)
preview = w.new_file()
w.run_command('new_pane')
view_id = preview.id()
current_view_settings.set('markdown_preview_id', view_id)
w.focus_group(focus_group)
w.focus_view(current_view)
return preview
def show_html(view, html):

View File

@ -1,5 +1,6 @@
# todo
Add a key binding hello world
This is awesome!
- add **custom css** feature
- check when setting is activated and create panel and stuff
- sync scroll
- regive focus to the right markdown view @done