Fixed IME in editor

This commit is contained in:
benweet 2014-05-04 18:30:14 +01:00
parent 68cce3a472
commit 61e472d7f0

View File

@ -43,9 +43,12 @@ define([
pagedownEditor = pagedownEditorParam; pagedownEditor = pagedownEditorParam;
}); });
var isComposing;
eventMgr.addListener('onSectionsCreated', function(newSectionList) { eventMgr.addListener('onSectionsCreated', function(newSectionList) {
updateSectionList(newSectionList); if(!isComposing) {
highlightSections(); updateSectionList(newSectionList);
highlightSections();
}
if(fileChanged === true) { if(fileChanged === true) {
// Refresh preview synchronously // Refresh preview synchronously
pagedownEditor.refreshPreview(); pagedownEditor.refreshPreview();
@ -727,6 +730,14 @@ define([
clearNewline = false; clearNewline = false;
} }
}) })
.on('compositionstart', function() {
isComposing = true;
console.log('compositionstart');
})
.on('compositionend', function() {
isComposing = false;
console.log('compositionend');
})
.on('mouseup', _.bind(selectionMgr.saveSelectionState, selectionMgr, true)) .on('mouseup', _.bind(selectionMgr.saveSelectionState, selectionMgr, true))
.on('paste', function() { .on('paste', function() {
undoMgr.currentMode = 'paste'; undoMgr.currentMode = 'paste';