focus the md_view back
This commit is contained in:
@ -42,9 +42,10 @@ def create_preview(md_view):
|
||||
preview.set_name(get_preview_name(md_view))
|
||||
preview.set_scratch(True)
|
||||
md_view_settings.set(PREVIEW_ID, preview.id())
|
||||
window.run_command('new_pane') # move to new group
|
||||
return preview
|
||||
|
||||
def move_and_focus_md_view():
|
||||
window.run_command('new_pane')
|
||||
sublime.set_timeout_async(lambda: window.focus_view(md_view), 50)
|
||||
sublime.set_timeout_async(move_and_focus_md_view, 250)
|
||||
|
||||
return preview
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@ class MarkdownLivePreviewListener(sublime_plugin.EventListener):
|
||||
id = vsettings.get(PREVIEW_ID)
|
||||
if id is None or get_view_from_id(window, id) is None:
|
||||
preview = create_preview(view)
|
||||
return
|
||||
|
||||
def on_activated(self, view):
|
||||
# if view is md_view and has no preview
|
||||
|
||||
Reference in New Issue
Block a user