diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/null-browser/extras/dmenu.lua | 3 | ||||
| -rw-r--r-- | lua/null-browser/extras/history.lua | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lua/null-browser/extras/dmenu.lua b/lua/null-browser/extras/dmenu.lua index 1bd467f..d08eb6a 100644 --- a/lua/null-browser/extras/dmenu.lua +++ b/lua/null-browser/extras/dmenu.lua @@ -1,3 +1,6 @@ +--- @type table +local uv = uv + local dmenu = {} function dmenu.select(list, opts, callback) diff --git a/lua/null-browser/extras/history.lua b/lua/null-browser/extras/history.lua index fe3f72f..4304dc0 100644 --- a/lua/null-browser/extras/history.lua +++ b/lua/null-browser/extras/history.lua @@ -14,7 +14,7 @@ function history.list() for line in string.gmatch(data, '[^\r\n]+') do local already_exists = false for _, url in ipairs(urls) do - if url == line then already_exists = true end + if url == line or url .. '/' == line then already_exists = true end end if #urls >= history.max_entires then break end if not already_exists then @@ -43,7 +43,7 @@ end function history.delete(url_to_delete) history.update(function(urls) - for index, url in urls do + for index, url in ipairs(urls) do if url == url_to_delete then table.remove(urls, index) return urls |
