Open hariharan605 opened 1 year ago
This is similar to the error that happens after calling session.destroy()
and leaving the destroyed session in the editor. Could you show your code, or a minimal example reproducing the issue?
@nightwing , I haven't used session model, I've directly configured the basePath, modePath and etc.
var CDN = "https://cdn.jsdelivr.net/npm/ace-builds@1.16.0/src-min-noconflict/";
window.ace.config.set('basePath', CDN);
window.ace.config.set('modePath', CDN);
window.ace.config.set('themePath', CDN);
window.ace.config.set('workerPath', CDN);
var editor = window.ace.edit("editor-divId");
this.editor.setOptions({
mode: 'ace/mode/text',
theme: 'ace/theme/crimson_editor',
fontSize: "15px",
showGutter: true,
showPrintMargin: false,
highlightActiveLine: false,
useWorker: false
});
Here, while changing mode using this.editor.setOption('mode', 'ace/mode/' + mode);
, it's causing the issue. But I couldn't narrow down the root cause.
I've never used session concept. If you suggest me to use it, please provide a working example, I'll adapt accordingly.
Do you get the same issue if you use this.editor.getSession().setMode('ace/mode/' + mode);
?
Do you get the same issue if you use
this.editor.getSession().setMode('ace/mode/' + mode);
?
Yes @akoreman , I tired using the suggested solution. It resulted same.
I've a doubt. I haven't set session while initialising but how getSession().setMode()
method will work ?
@hariharan605 are you using the same version for both ace and the cdn? the cdn version of 1.16.0 you are using is a bit old. I have tried to recreate the issue with the code you have provided above, but when versions of cdn url and ace.js match it does not throw an error. See here
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Describe the bug
Using ace-build NPM package - Version 1.16.0
Use case 1 :
and
Whenever I try to delete a whole document and enter a new character, it gets printed twice and the above error displayed in console.
Use case 2 :
Whenever I try to cut the code, the last two lines of the code gets copied to clipboard whereas other lines were gone and the above error displayed in console.
A help would be seriously appreciable as I struck in this for weeks and couldn't figure out what went wrong here.
Expected Behavior
Use case 1 : No double character printing should happen.
Use case 2 : Cut operation should happen flawlessly.
Current Behavior
Use case 1 : Whenever I try to delete a whole document and enter a new character, it gets printed twice and the above error displayed in console.
Use case 2 : Whenever I try to cut the code, the last two lines of the code gets copied to clipboard whereas other lines were gone and the above error displayed in console.
Reproduction Steps
Use case 1 : Whenever I try to delete a whole document and enter a new character, it gets printed twice and the above error displayed in console.
Use case 2 : Whenever I try to cut the code, the last two lines of the code gets copied to clipboard whereas other lines were gone and the above error displayed in console.
Possible Solution
No response
Additional Information/Context
No response
Ace Version / Browser / OS / Keyboard layout
ace : 1.16.0, macos 12.6.5, Chrome 115.0.5790.114