Skip to content

Commit

Permalink
fix: use vim.notify not to block outputs
Browse files Browse the repository at this point in the history
See #75
  • Loading branch information
delphinus committed Apr 9, 2023
1 parent c56bb82 commit 98ed91a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lua/frecency/db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function db.remove(entries, silent)
local count = fs:count()
fs:remove()
if not vim.F.if_nil(silent, false) then
print(("Telescope-frecency: removed all entries. number of entries removed %d ."):format(count))
vim.notify(("Telescope-frecency: removed all entries. number of entries removed %d ."):format(count))
end
return
end
Expand All @@ -155,7 +155,7 @@ function db.remove(entries, silent)
end

if not vim.F.if_nil(silent, false) then
print(("Telescope-frecency: removed %d missing entries."):format(#entries))
vim.notify(("Telescope-frecency: removed %d missing entries."):format(#entries))
end
end

Expand Down
2 changes: 1 addition & 1 deletion lua/frecency/picker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ m.setup = function(config)
for _, path in ipairs(oldfiles) do
fs.insert { path = path, count = 0 } -- TODO: remove when sql.nvim#97 is closed
end
print(("Telescope-Frecency: Imported %d entries from oldfiles."):format(#oldfiles))
vim.notify(("Telescope-Frecency: Imported %d entries from oldfiles."):format(#oldfiles))
end

-- TODO: perhaps ignore buffer without file path here?
Expand Down
2 changes: 1 addition & 1 deletion lua/frecency/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ end

util.abort_remove_unlinked_files = function()
---TODO: refactor all messages to a lua file. alarts.lua?
print "TelescopeFrecency: validation aborted."
vim.notify "TelescopeFrecency: validation aborted."
end

util.tbl_match = function(field, val, tbl)
Expand Down

0 comments on commit 98ed91a

Please sign in to comment.