Disable link clicking by holding shift ctrl or meta

pull/223/head
Ruben Daniels 2015-11-12 18:55:04 +00:00
rodzic 6b5b16559b
commit 96ef199e6c
2 zmienionych plików z 13 dodań i 13 usunięć

Wyświetl plik

@ -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();

Wyświetl plik

@ -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;