kopia lustrzana https://github.com/c9/core
Disable link clicking by holding shift ctrl or meta
rodzic
6b5b16559b
commit
96ef199e6c
|
@ -298,10 +298,10 @@ var HoverLink = function(editor) {
|
||||||
match.value = value.replace(/['">)}\].,;:]+$/, "");
|
match.value = value.replace(/['">)}\].,;:]+$/, "");
|
||||||
}
|
}
|
||||||
else if (/^[ab]?\//.test(value) && /^([+\-]{3}|diff)/.test(line)) { // diff
|
else if (/^[ab]?\//.test(value) && /^([+\-]{3}|diff)/.test(line)) { // diff
|
||||||
match.type = "path";
|
match.type = "path";
|
||||||
match.basePath = "";
|
match.basePath = "";
|
||||||
match.start++;
|
match.start++;
|
||||||
match.value = value.substr(2);
|
match.value = value.substr(2);
|
||||||
}
|
}
|
||||||
else if (prompt.command === "git") { // git status
|
else if (prompt.command === "git") { // git status
|
||||||
var prefix = line.substr(0, match.start);
|
var prefix = line.substr(0, match.start);
|
||||||
|
@ -378,6 +378,9 @@ var HoverLink = function(editor) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onMouseMove = function(e) {
|
this.onMouseMove = function(e) {
|
||||||
|
if (e.shiftKey || e.ctrlKey || e.metaKey)
|
||||||
|
return this.clear();
|
||||||
|
|
||||||
if (this.editor.$mouseHandler.isMousePressed) {
|
if (this.editor.$mouseHandler.isMousePressed) {
|
||||||
if (!this.editor.selection.isEmpty())
|
if (!this.editor.selection.isEmpty())
|
||||||
this.clear();
|
this.clear();
|
||||||
|
|
|
@ -38,11 +38,11 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
terminal.on("create", function(e) {
|
terminal.on("create", function(e) {
|
||||||
var ace = e.editor.ace;
|
var ace = e.editor.ace;
|
||||||
if (!ace)
|
if (!ace) return;
|
||||||
return;
|
|
||||||
ace.hoverLink = new HoverLink(ace);
|
ace.hoverLink = new HoverLink(ace);
|
||||||
ace.hoverLink.on("open", showMenu);
|
ace.hoverLink.on("open", showMenu);
|
||||||
});
|
}, plugin);
|
||||||
|
|
||||||
function createMenu(e) {
|
function createMenu(e) {
|
||||||
if (menu)
|
if (menu)
|
||||||
|
@ -71,9 +71,6 @@ define(function(require, exports, module) {
|
||||||
? "Unable to access via preview"
|
? "Unable to access via preview"
|
||||||
: BASEPATH + info.path });
|
: BASEPATH + info.path });
|
||||||
}
|
}
|
||||||
// else if (e.value == "github") {
|
|
||||||
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}, plugin);
|
}, plugin);
|
||||||
|
|
||||||
|
@ -92,7 +89,6 @@ define(function(require, exports, module) {
|
||||||
new MenuItem({ caption: "Copy Special", submenu: submenu }),
|
new MenuItem({ caption: "Copy Special", submenu: submenu }),
|
||||||
new Divider(),
|
new Divider(),
|
||||||
new MenuItem({ value: "reveal", caption: "Reveal in File Tree" })
|
new MenuItem({ value: "reveal", caption: "Reveal in File Tree" })
|
||||||
// new MenuItem({ caption: "Open in GitHub" }),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
menu = new Menu({
|
menu = new Menu({
|
||||||
|
@ -168,7 +164,8 @@ define(function(require, exports, module) {
|
||||||
window.open(href);
|
window.open(href);
|
||||||
else
|
else
|
||||||
commands.exec("preview", null, { path: href });
|
commands.exec("preview", null, { path: href });
|
||||||
} else if (e.type == "path") {
|
}
|
||||||
|
else if (e.type == "path") {
|
||||||
var info = buildPath(e);
|
var info = buildPath(e);
|
||||||
var path = info.path;
|
var path = info.path;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue