kopia lustrzana https://github.com/c9/core
Merge pull request +7139 from c9/fix/various
Fix several small issuespull/85/head
commit
0f2745a33c
|
@ -423,6 +423,12 @@ exports.commands = [{
|
|||
exec: function() {},
|
||||
passEvent: true,
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "copy",
|
||||
exec: function(editor) {
|
||||
// placeholder for replay macro
|
||||
},
|
||||
readOnly: true
|
||||
},
|
||||
|
||||
// commands disabled in readOnly mode
|
||||
|
@ -439,6 +445,12 @@ exports.commands = [{
|
|||
},
|
||||
scrollIntoView: "cursor",
|
||||
multiSelectAction: "forEach"
|
||||
}, {
|
||||
name: "paste",
|
||||
exec: function(editor, text) {
|
||||
editor.$handlePaste(text);
|
||||
},
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "removeline",
|
||||
bindKey: bindKey("Ctrl-D", "Command-D"),
|
||||
|
|
|
@ -903,10 +903,10 @@ var Editor = function(renderer, session) {
|
|||
*
|
||||
**/
|
||||
this.onPaste = function(text) {
|
||||
// todo this should change when paste becomes a command
|
||||
if (this.$readOnly)
|
||||
return;
|
||||
|
||||
this.commands.exec("paste", this, text);
|
||||
};
|
||||
|
||||
this.$handlePaste = function(text) {
|
||||
var e = {text: text};
|
||||
this._signal("paste", e);
|
||||
text = e.text;
|
||||
|
@ -927,7 +927,6 @@ var Editor = function(renderer, session) {
|
|||
this.session.insert(range.start, lines[i]);
|
||||
}
|
||||
}
|
||||
this.renderer.scrollCursorIntoView();
|
||||
};
|
||||
|
||||
this.execCommand = function(command, args) {
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
"c9.ide.language.javascript.tern": "#7aab8b0b6a",
|
||||
"c9.ide.language.javascript.infer": "#cfec494a3c",
|
||||
"c9.ide.language.jsonalyzer": "#21b64e5820",
|
||||
"c9.ide.collab": "#edef363853",
|
||||
"c9.ide.collab": "#0b8d47b8b7",
|
||||
"c9.ide.local": "#2bfd7ff051",
|
||||
"c9.ide.find": "#6cc6d3379d",
|
||||
"c9.ide.find.infiles": "#72582de3cd",
|
||||
|
@ -81,9 +81,9 @@
|
|||
"c9.ide.fontawesome": "#781602c5d8",
|
||||
"c9.ide.format": "#f51451ac57",
|
||||
"c9.ide.help.support": "#60e88f5680",
|
||||
"c9.ide.imgeditor": "#08bbc53578",
|
||||
"c9.ide.imgeditor": "#ed89162aa7",
|
||||
"c9.ide.immediate": "#6845a93705",
|
||||
"c9.ide.installer": "#6f8f44c9e1",
|
||||
"c9.ide.installer": "#91b3cc12f8",
|
||||
"c9.ide.mount": "#32e79866ee",
|
||||
"c9.ide.navigate": "#64156c7f4a",
|
||||
"c9.ide.newresource": "#f1f0624768",
|
||||
|
|
|
@ -10,7 +10,7 @@ define(function(require, module, exports) {
|
|||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
var emit = plugin.getEmitter();
|
||||
|
||||
var position = -1, mark = null, stack = [];
|
||||
var position = -1, mark = -2, stack = [];
|
||||
|
||||
if (options)
|
||||
setState(options);
|
||||
|
@ -55,7 +55,7 @@ define(function(require, module, exports) {
|
|||
position = 0;
|
||||
|
||||
if (mark < position)
|
||||
mark = -1;
|
||||
mark = -2;
|
||||
|
||||
emit("change");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ define(function(require, module, exports) {
|
|||
stack = stack.slice(0, position + 1);
|
||||
|
||||
if (mark > position)
|
||||
mark = -1;
|
||||
mark = -2;
|
||||
|
||||
if (!noEvent)
|
||||
emit("change");
|
||||
|
@ -91,7 +91,7 @@ define(function(require, module, exports) {
|
|||
position--;
|
||||
|
||||
if (mark == idx)
|
||||
mark = -1;
|
||||
mark = -2;
|
||||
else if (mark > idx)
|
||||
mark--;
|
||||
|
||||
|
@ -105,8 +105,7 @@ define(function(require, module, exports) {
|
|||
}
|
||||
|
||||
function isAtBookmark(){
|
||||
return mark !== null && mark == position
|
||||
|| mark === null && position == -1;
|
||||
return mark == position;
|
||||
}
|
||||
|
||||
function item(idx) {
|
||||
|
@ -133,7 +132,7 @@ define(function(require, module, exports) {
|
|||
return; // guard against broken stack
|
||||
stack = state.stack;
|
||||
|
||||
emit("change"); //If you remove this again, change the test
|
||||
emit("change"); // If you remove this again, change the test
|
||||
}
|
||||
|
||||
function findItem(compressedItem) {
|
||||
|
@ -146,7 +145,7 @@ define(function(require, module, exports) {
|
|||
|
||||
position = -1;
|
||||
stack = [];
|
||||
mark = null;
|
||||
mark = -1;
|
||||
|
||||
emit("change");
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
expect(undo.position).to.equal(4);
|
||||
undo.undo(); check++;
|
||||
|
||||
undo.setState({ position : -1, stack : stack, mark : null }); check++;
|
||||
undo.setState({ position : -1, stack : stack, mark : -1 }); check++;
|
||||
expect(undo.isAtBookmark()).to.equal(true);
|
||||
expect(data).to.deep.equal(["a", "q"]);
|
||||
checkCount();
|
||||
|
|
Ładowanie…
Reference in New Issue