1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-03 12:44:10 +01:00

refactored some yanking code

This commit is contained in:
Martin Stubenschrott
2008-01-05 23:31:07 +00:00
parent 642ac2ba27
commit 43038f7566
5 changed files with 13 additions and 28 deletions

View File

@@ -838,12 +838,7 @@ vimperator.Mappings = function () //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["y"],
function ()
{
var url = vimperator.buffer.URL;
vimperator.copyToClipboard(url);
vimperator.echo("Yanked " + url, vimperator.commandline.FORCE_SINGLELINE);
},
function () { vimperator.copyToClipboard(vimperator.buffer.URL, true); },
{
shortHelp: "Yank current location to the clipboard",
help: "When running in X11 the location is also put into the selection, which can be pasted with the middle mouse button."
@@ -853,7 +848,10 @@ vimperator.Mappings = function () //{{{
function ()
{
var sel = window.content.document.getSelection();
vimperator.copyToClipboard(sel);
if (sel)
vimperator.copyToClipboard(sel, true);
else
vimperator.beep();
},
{
shortHelp: "Copy selected text",