1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 11:08:09 +01:00

"Yanked {n} line(s)"

This commit is contained in:
Kris Maglione
2010-10-14 19:37:10 -04:00
parent e44b0f60d4
commit ae485fc35d

View File

@@ -1245,8 +1245,10 @@ const Commands = Module("commands", {
commands.add(["y[ank]"], commands.add(["y[ank]"],
"Yanks the output of the given command to the clipboard", "Yanks the output of the given command to the clipboard",
function (args) { function (args) {
dactyl.clipboardWrite( let res = commandline.withOutputToString(commands.execute, commands, args[0]);
commandline.withOutputToString(commands.execute, commands, args[0])); dactyl.clipboardWrite(res);
let lines = res.split("\n").length;
dactyl.echomsg("Yanked " + lines + " line" + (lines == 1 ? "" : "s"));
}, },
{ {
completer: function (context) completion.ex(context), completer: function (context) completion.ex(context),