diff --git a/plugins/c9.ide.terminal/aceterm/hover_link.js b/plugins/c9.ide.terminal/aceterm/hover_link.js index d38f554b..cbbab329 100644 --- a/plugins/c9.ide.terminal/aceterm/hover_link.js +++ b/plugins/c9.ide.terminal/aceterm/hover_link.js @@ -298,10 +298,10 @@ var HoverLink = function(editor) { match.value = value.replace(/['">)}\].,;:]+$/, ""); } else if (/^[ab]?\//.test(value) && /^([+\-]{3}|diff)/.test(line)) { // diff - match.type = "path"; - match.basePath = ""; - match.start++; - match.value = value.substr(2); + match.type = "path"; + match.basePath = ""; + match.start++; + match.value = value.substr(2); } else if (prompt.command === "git") { // git status var prefix = line.substr(0, match.start); @@ -378,6 +378,9 @@ var HoverLink = function(editor) { }; this.onMouseMove = function(e) { + if (e.shiftKey || e.ctrlKey || e.metaKey) + return this.clear(); + if (this.editor.$mouseHandler.isMousePressed) { if (!this.editor.selection.isEmpty()) this.clear(); diff --git a/plugins/c9.ide.terminal/link_handler.js b/plugins/c9.ide.terminal/link_handler.js index fb744d5c..47b0eccd 100644 --- a/plugins/c9.ide.terminal/link_handler.js +++ b/plugins/c9.ide.terminal/link_handler.js @@ -38,17 +38,17 @@ define(function(require, exports, module) { terminal.on("create", function(e) { var ace = e.editor.ace; - if (!ace) - return; + if (!ace) return; + ace.hoverLink = new HoverLink(ace); ace.hoverLink.on("open", showMenu); - }); + }, plugin); function createMenu(e) { if (menu) return; - var submenu = new Menu({ + var submenu = new Menu({ items: [ new MenuItem({ value: "path", caption: "Copy Path" }), new MenuItem({ value: "directory", caption: "Copy Directory" }), @@ -71,9 +71,6 @@ define(function(require, exports, module) { ? "Unable to access via preview" : BASEPATH + info.path }); } - // else if (e.value == "github") { - - // } } }, plugin); @@ -92,7 +89,6 @@ define(function(require, exports, module) { new MenuItem({ caption: "Copy Special", submenu: submenu }), new Divider(), new MenuItem({ value: "reveal", caption: "Reveal in File Tree" }) - // new MenuItem({ caption: "Open in GitHub" }), ]; menu = new Menu({ @@ -168,7 +164,8 @@ define(function(require, exports, module) { window.open(href); else commands.exec("preview", null, { path: href }); - } else if (e.type == "path") { + } + else if (e.type == "path") { var info = buildPath(e); var path = info.path;