Commit 77fd986c authored by Jérome Perrin's avatar Jérome Perrin

code_mirror: support for YAPF

parent cdc4177a
...@@ -239,6 +239,25 @@ ...@@ -239,6 +239,25 @@
function successHandler(data) { function successHandler(data) {
generateHistorySelectElement(); generateHistorySelectElement();
/* check getTextContent have not changed server side (for example YAPF) */
if (mode == 'python') {
$.ajax({
type: 'GET',
url: 'getTextContent',
success: function refreshTextContent(textContent) {
if (textContent !== cm.getValue()) {
if (cm.hasFocus()) {
const cursorPosition = cm.getCursor();
cm.setValue(textContent);
cm.setCursor(cursorPosition);
} else {
cm.setValue(textContent);
}
}
}
});
}
transition_message = $('#transition_message'); transition_message = $('#transition_message');
transition_message.css('opacity', 0.0); transition_message.css('opacity', 0.0);
transition_message.html(data); transition_message.html(data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment