Преглед на файлове

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

Enrico Berti преди 9 години
родител
ревизия
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);
       });