From 68a6a14d909f58e84b58199f6c8a267f49883a21 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 3 May 2015 14:55:08 +0400 Subject: [PATCH 1/5] fix clearUndo --- plugins/c9.ide.editors/undomanager.js | 15 +++++++-------- plugins/c9.ide.editors/undomanager_test.js | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/plugins/c9.ide.editors/undomanager.js b/plugins/c9.ide.editors/undomanager.js index 6ab1adc9..6560de05 100644 --- a/plugins/c9.ide.editors/undomanager.js +++ b/plugins/c9.ide.editors/undomanager.js @@ -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"); } diff --git a/plugins/c9.ide.editors/undomanager_test.js b/plugins/c9.ide.editors/undomanager_test.js index b7624924..a3c57ada 100644 --- a/plugins/c9.ide.editors/undomanager_test.js +++ b/plugins/c9.ide.editors/undomanager_test.js @@ -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(); From a7033da9751bb909a5831a4a56bdbfda0cdb997b Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 21 Dec 2014 23:01:01 +0400 Subject: [PATCH 2/5] convert paste into command --- .../ace/lib/ace/commands/default_commands.js | 12 ++++++++++++ node_modules/ace/lib/ace/editor.js | 9 ++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/node_modules/ace/lib/ace/commands/default_commands.js b/node_modules/ace/lib/ace/commands/default_commands.js index f1e267c1..dddce931 100644 --- a/node_modules/ace/lib/ace/commands/default_commands.js +++ b/node_modules/ace/lib/ace/commands/default_commands.js @@ -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"), diff --git a/node_modules/ace/lib/ace/editor.js b/node_modules/ace/lib/ace/editor.js index 500cfc45..0602e7fd 100644 --- a/node_modules/ace/lib/ace/editor.js +++ b/node_modules/ace/lib/ace/editor.js @@ -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) { From d614198e350e4915ff17960458afb687d83e0fb9 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 2 May 2015 05:09:14 +0400 Subject: [PATCH 3/5] fix collab showAuthorInfo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa5a7a28..4c3ea492 100644 --- a/package.json +++ b/package.json @@ -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", From 333dee97da73da7febcbadd667f6478545e60b74 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 3 May 2015 20:43:36 +0400 Subject: [PATCH 4/5] fix +7113 Image width shows as 0px on image preview --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4c3ea492..c9ebba40 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "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.mount": "#32e79866ee", From d3c66bee4c13ec22012bba0699deece46d0a64b0 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 3 May 2015 20:28:09 +0400 Subject: [PATCH 5/5] fix installer on windows --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c9ebba40..46b73fc0 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "c9.ide.help.support": "#60e88f5680", "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",