awful.prompt: add support for Shift+Insert to paste

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-01-04 17:44:37 +01:00
parent c8c2c75472
commit 5751049745
1 changed files with 14 additions and 2 deletions

View File

@ -11,7 +11,8 @@ local table = table
local math = math
local capi =
{
keygrabber = keygrabber
keygrabber = keygrabber,
selection = selection
}
local util = require("awful.util")
local beautiful = require("beautiful")
@ -253,7 +254,18 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his
end
-- Typin cases
if key == "Home" then
if mod.Shift and key == "Insert" then
local selection = capi.selection()
if selection then
-- Remove \n
local n = selection:find("\n")
if n then
selection = selection:sub(1, n - 1)
end
command = command .. selection
cur_pos = cur_pos + #selection
end
elseif key == "Home" then
cur_pos = 1
elseif key == "End" then
cur_pos = #command + 1