From 35e53cb683972d2d03c5a8043e404e4eef7159c9 Mon Sep 17 00:00:00 2001 From: math2001 Date: Fri, 25 Nov 2016 08:29:23 +1100 Subject: [PATCH] refocus to the md view when creating preview --- md_in_popup.py | 3 +++ todo.md | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/md_in_popup.py b/md_in_popup.py index 9533337..664ea43 100644 --- a/md_in_popup.py +++ b/md_in_popup.py @@ -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): diff --git a/todo.md b/todo.md index 7fd2b94..907b284 100644 --- a/todo.md +++ b/todo.md @@ -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