浏览代码

HUE-6154 [core] Ace paste event shouldn't reset the cursor position

Enrico Berti 8 年之前
父节点
当前提交
181f585
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 2 - 0
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -3569,9 +3569,11 @@
         window.clearInterval(checkEditorValueInterval);
         checkEditorValueInterval = window.setInterval(function () {
           if (lastEditorValue !== editor.getValue()) {
+            var lastKnownPosition = editor.getCursorPosition();
             window.clearInterval(checkEditorValueInterval);
             lastEditorValue = editor.getValue();
             editor.setValue(removeUnicodes(lastEditorValue), 1);
+            editor.moveCursorToPosition(lastKnownPosition);
           }
         }, 10);
       });