✨ use setting for delay before updating preview
This commit is contained in:
@ -12,5 +12,8 @@
|
|||||||
|
|
||||||
// Choose what to do with YAML/TOML (---/+++ respectively) headers
|
// Choose what to do with YAML/TOML (---/+++ respectively) headers
|
||||||
// Valid values: "wrap_in_pre", "remove".
|
// Valid values: "wrap_in_pre", "remove".
|
||||||
"header_action": "wrap_in_pre"
|
"header_action": "wrap_in_pre",
|
||||||
|
|
||||||
|
// Wait at least the specified *seconds* before updating the preview.
|
||||||
|
"update_preview_every": 0
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class MarkdownLivePreviewListener(sublime_plugin.EventListener):
|
|||||||
def update(self, view):
|
def update(self, view):
|
||||||
vsettings = view.settings()
|
vsettings = view.settings()
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if now - vsettings.get(LAST_RUN, 0) < 0.8:
|
if now - vsettings.get(LAST_RUN, 0) < get_settings().get('update_preview_every'):
|
||||||
return
|
return
|
||||||
vsettings.set(LAST_RUN, now)
|
vsettings.set(LAST_RUN, now)
|
||||||
if not vsettings.get(PREVIEW_ENABLED):
|
if not vsettings.get(PREVIEW_ENABLED):
|
||||||
|
|||||||
Reference in New Issue
Block a user