mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-10-21 20:10:38 +00:00
Use vim.notify not to block outputs (#75)
This commit is contained in:
parent
d51c7631dc
commit
4d72ee8002
@ -27,7 +27,7 @@ local function import_oldfiles()
|
|||||||
for _, filepath in pairs(oldfiles) do
|
for _, filepath in pairs(oldfiles) do
|
||||||
sql_wrapper:update(filepath)
|
sql_wrapper:update(filepath)
|
||||||
end
|
end
|
||||||
print(("Telescope-Frecency: Imported %d entries from oldfiles."):format(#oldfiles))
|
vim.notify(("Telescope-Frecency: Imported %d entries from oldfiles."):format(#oldfiles))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function file_is_ignored(filepath)
|
local function file_is_ignored(filepath)
|
||||||
@ -65,7 +65,7 @@ local function validate_db(safe_mode)
|
|||||||
if user_response == 1 then
|
if user_response == 1 then
|
||||||
confirmed = true
|
confirmed = true
|
||||||
else
|
else
|
||||||
vim.defer_fn(function() print("TelescopeFrecency: validation aborted.") end, 50)
|
vim.defer_fn(function() vim.notify("TelescopeFrecency: validation aborted.") end, 50)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
confirmed = true
|
confirmed = true
|
||||||
@ -78,9 +78,9 @@ local function validate_db(safe_mode)
|
|||||||
sql_wrapper:do_transaction(queries.file_delete_entry , {where = {id = entry.id }})
|
sql_wrapper:do_transaction(queries.file_delete_entry , {where = {id = entry.id }})
|
||||||
sql_wrapper:do_transaction(queries.timestamp_delete_entry, {where = {file_id = entry.id}})
|
sql_wrapper:do_transaction(queries.timestamp_delete_entry, {where = {file_id = entry.id}})
|
||||||
end
|
end
|
||||||
print(('Telescope-Frecency: removed %d missing entries.'):format(#pending_remove))
|
vim.notify(('Telescope-Frecency: removed %d missing entries.'):format(#pending_remove))
|
||||||
else
|
else
|
||||||
print("Telescope-Frecency: validation aborted.")
|
vim.notify("Telescope-Frecency: validation aborted.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -45,7 +45,7 @@ function M:bootstrap(db_root)
|
|||||||
local db_filename = db_root .. "/file_frecency.sqlite3"
|
local db_filename = db_root .. "/file_frecency.sqlite3"
|
||||||
self.db = sqlite:open(db_filename)
|
self.db = sqlite:open(db_filename)
|
||||||
if not self.db then
|
if not self.db then
|
||||||
print("error")
|
vim.notify("Telescope-Frecency: error in opening DB", vim.log.levels.ERROR)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user