From 77a2b2742658d8ab18abebbc7ee33324fa6871ae Mon Sep 17 00:00:00 2001 From: Massimiliano Brocchini Date: Sat, 22 Feb 2014 12:21:09 +0100 Subject: [PATCH] prompt: fix search term ctrl+up/ctrl+down when starting from existing entries Signed-off-by: Massimiliano Brocchini Signed-off-by: Uli Schlachter --- lib/awful/prompt.lua.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/awful/prompt.lua.in b/lib/awful/prompt.lua.in index 62ce2484..14c0ca8c 100644 --- a/lib/awful/prompt.lua.in +++ b/lib/awful/prompt.lua.in @@ -312,7 +312,7 @@ function prompt.run(args, textbox, exe_callback, completion_callback, history_pa command = command:sub(cur_pos, #command) cur_pos = 1 elseif key == "Up" then - search_term = search_term or command:sub(1, cur_pos - 1) + search_term = command:sub(1, cur_pos - 1) or "" for i,v in (function(a,i) return itera(-1,a,i) end), data.history[history_path].table, history_index do if v:find('^'..search_term) ~= nil then command=v @@ -321,7 +321,7 @@ function prompt.run(args, textbox, exe_callback, completion_callback, history_pa end end elseif key == "Down" then - search_term = search_term or command:sub(1, cur_pos - 1) + search_term = command:sub(1, cur_pos - 1) or "" for i,v in (function(a,i) return itera(1,a,i) end), data.history[history_path].table, history_index do if v:find('^'..search_term) ~= nil then command=v