Przeglądaj źródła

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

Enrico Berti 8 lat temu
rodzic
commit
181f585

+ 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);
       });