kopia lustrzana https://github.com/c9/core
Merge pull request +14014 from c9/ide-terminal-ime
minimal fix for ime in terminalpull/312/head
commit
6ba3f217c8
|
@ -148,7 +148,7 @@ var EditSession = function(text, mode) {
|
||||||
this.$undoSelect = true;
|
this.$undoSelect = true;
|
||||||
|
|
||||||
this.$foldData = [];
|
this.$foldData = [];
|
||||||
this.id = "session" + EditSession.$uid;
|
this.id = "session" + (++EditSession.$uid);
|
||||||
this.$foldData.toString = function() {
|
this.$foldData.toString = function() {
|
||||||
return this.join("\n");
|
return this.join("\n");
|
||||||
};
|
};
|
||||||
|
|
|
@ -364,10 +364,11 @@ var TextInput = function(parentNode, host) {
|
||||||
return;
|
return;
|
||||||
// console.log("onCompositionStart", inComposition)
|
// console.log("onCompositionStart", inComposition)
|
||||||
inComposition = {};
|
inComposition = {};
|
||||||
|
inComposition.canUndo = host.session.$undoManager;
|
||||||
host.onCompositionStart();
|
host.onCompositionStart();
|
||||||
setTimeout(onCompositionUpdate, 0);
|
setTimeout(onCompositionUpdate, 0);
|
||||||
host.on("mousedown", onCompositionEnd);
|
host.on("mousedown", onCompositionEnd);
|
||||||
if (!host.selection.isEmpty()) {
|
if (inComposition.canUndo && !host.selection.isEmpty()) {
|
||||||
host.insert("");
|
host.insert("");
|
||||||
host.session.markUndoGroup();
|
host.session.markUndoGroup();
|
||||||
host.selection.clearSelection();
|
host.selection.clearSelection();
|
||||||
|
@ -385,6 +386,7 @@ var TextInput = function(parentNode, host) {
|
||||||
host.onCompositionUpdate(val);
|
host.onCompositionUpdate(val);
|
||||||
if (inComposition.lastValue)
|
if (inComposition.lastValue)
|
||||||
host.undo();
|
host.undo();
|
||||||
|
if (inComposition.canUndo)
|
||||||
inComposition.lastValue = val;
|
inComposition.lastValue = val;
|
||||||
if (inComposition.lastValue) {
|
if (inComposition.lastValue) {
|
||||||
var r = host.selection.getRange();
|
var r = host.selection.getRange();
|
||||||
|
|
Ładowanie…
Reference in New Issue