From 92cadc03fa68ad39f68fb8b0ddb359cbefaa59c8 Mon Sep 17 00:00:00 2001 From: eight Date: Thu, 9 Nov 2017 07:19:22 +0800 Subject: [PATCH] Fix: avoid return short circuit for editor selection --- edit/edit.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/edit/edit.js b/edit/edit.js index 20f99455..c232271f 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -998,11 +998,11 @@ function jumpToLine(cm) { } function toggleStyle() { - if (!editor) { + if (editor) { + editor.toggleStyle(); + } else { toggleSectionStyle(); - return; } - editor.toggleStyle(); } function toggleSectionStyle() { @@ -1560,11 +1560,11 @@ function updateLintReportIfEnabled(...args) { } function save() { - if (!editor) { + if (editor) { + editor.save(); + } else { saveSectionStyle(); - return; } - editor.save(); } function saveSectionStyle() {