From 97befb6238f2a364c73f1158923a50f6b8752f7f Mon Sep 17 00:00:00 2001 From: Cheng-Han, Wu Date: Mon, 16 May 2016 23:02:59 +0800 Subject: Fix on paste or cut text might trigger syncscroll --- public/js/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'public/js/index.js') diff --git a/public/js/index.js b/public/js/index.js index e47b8c18..7465044a 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -822,7 +822,7 @@ function checkEditorScrollbar() { // workaround simple scroll bar knob // will get wrong position when editor height changed var scrollInfo = editor.getScrollInfo(); - preventSyncScroll = true; + if (!preventSyncScroll) preventSyncScroll = true; editor.scrollTo(null, scrollInfo.top - 1); editor.scrollTo(null, scrollInfo.top); } @@ -2422,9 +2422,11 @@ editor.on('beforeChange', function (cm, change) { cmClient.editorAdapter.ignoreNextChange = true; }); editor.on('cut', function () { + preventSyncScroll = 3; windowResize(); //workaround for scrollMap }); editor.on('paste', function () { + preventSyncScroll = 3; windowResize(); //workaround for scrollMap }); editor.on('changes', function (cm, changes) { -- cgit v1.2.3