On 04.12.2011 02:03, Corey Thompson wrote:
> ---
>  lib/awful/prompt.lua.in |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/awful/prompt.lua.in b/lib/awful/prompt.lua.in
> index 703c9d7..789ed3e 100644
> --- a/lib/awful/prompt.lua.in
> +++ b/lib/awful/prompt.lua.in
> @@ -97,9 +97,9 @@ end
>  -- @param id The data.history identifier
>  -- @param command The command to add
>  local function history_add(id, command)
> -    if data.history[id] then
> -        if command ~= ""
> -            and util.table.hasitem(data.history[id].table, command) == nil 
> then
> +    if data.history[id] and command ~= "" then
> +        local index = util.table.hasitem(data.history[id].table, command)
> +        if index == nil then
>              table.insert(data.history[id].table, command)
>  
>              -- Do not exceed our max_cmd
> @@ -108,6 +108,11 @@ local function history_add(id, command)
>              end
>  
>              history_save(id)
> +        else
> +            -- Bump this command to the end of history
> +            table.remove(data.history[id].table, index)
> +            table.insert(data.history[id].table, command)
> +            history_save(id)
>          end
>      end
>  end

Pushed, thanks

-- 
Q: Because it reverses the logical flow of conversation.
A: Why is putting a reply at the top of the message frowned upon?

-- 
To unsubscribe, send mail to [email protected].

Reply via email to