1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-28 14:02:36 +01:00

Yank short URL with 'y' if provided.

This commit is contained in:
Kris Maglione
2011-10-27 01:09:13 -04:00
parent e50726ae01
commit 11deba65e9

View File

@@ -1833,7 +1833,11 @@ var Buffer = Module("Buffer", {
mappings.add([modes.NORMAL],
["y", "<yank-location>"], "Yank current location to the clipboard",
function () { dactyl.clipboardWrite(buffer.uri.spec, true); });
function () {
let link = DOM("link[href][rev=canonical], link[href][rel=shortlink]", buffer.doc);
let url = link.length ? link.attr("href") : buffer.uri.spec;
dactyl.clipboardWrite(url, true);
});
mappings.add([modes.NORMAL],
["<C-a>", "<increment-url-path>"], "Increment last number in URL",