Progressive-Learning-Platform / PLPTool6

Prototype for PLPTool frontend interface overhaul
2 stars 4 forks source link

Control+V (Paste) is pasting content or text two times in the code editor #78

Open harsha-kadekar opened 7 years ago

tobielf commented 6 years ago

@tanpuresiddhant Try to reproduce this bug, and analysis the reason.

tobielf commented 6 years ago

@tanpuresiddhant "Yes updateTextfromJavascript is running twice, and I couldn’t find the reason".

Try line231 in CodeEditor.java, if you comment out webView.getEngine().executeScript("editor.onPaste('" + sanitizeForAce(content) + "');");, it only paste once, but this bug cannot simply fixed by this method.

It looks like the previous developer tries to do some conversion from the clipboard, then put them back to the editor(replace the original text, but it failed, so we see two identical content).

Go through the ACE Editor API Page, comes out a proper solution for this.