Skip to content

Commit 697481f

Browse files
authored
fix: tostring() the result in vim.notify calls (#322)
1 parent bb6f32a commit 697481f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

lua/fff/core.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ M.ensure_initialized = function()
8888
local history_db_path = config.history.db_path or (vim.fn.stdpath('data') .. '/fff_history')
8989

9090
local ok, result = pcall(fuzzy.init_db, frecency_db_path, history_db_path, true)
91-
if not ok then vim.notify('Failed to databases: ' .. result, vim.log.levels.WARN) end
91+
if not ok then vim.notify('Failed to databases: ' .. tostring(result), vim.log.levels.WARN) end
9292

9393
ok, result = pcall(fuzzy.init_file_picker, config.base_path)
9494
if not ok then
95-
vim.notify('Failed to initialize file picker: ' .. result, vim.log.levels.ERROR)
95+
vim.notify('Failed to initialize file picker: ' .. tostring(result), vim.log.levels.ERROR)
9696
return fuzzy
9797
end
9898

lua/fff/file_picker/init.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function M.scan_files()
2424

2525
local ok, result = pcall(fuzzy.scan_files)
2626
if not ok then
27-
vim.notify('Failed to trigger file scan: ' .. result, vim.log.levels.ERROR)
27+
vim.notify('Failed to trigger file scan: ' .. tostring(result), vim.log.levels.ERROR)
2828
return
2929
end
3030

@@ -121,7 +121,7 @@ function M.track_access(file_path)
121121
if not M.state.initialized then return end
122122

123123
local ok, result = pcall(fuzzy.track_access, file_path)
124-
if not ok then vim.notify('Failed to record file access: ' .. result, vim.log.levels.WARN) end
124+
if not ok then vim.notify('Failed to record file access: ' .. tostring(result), vim.log.levels.WARN) end
125125
end
126126

127127
--- Get file content for preview
@@ -156,7 +156,7 @@ function M.get_scan_progress()
156156

157157
local ok, result = pcall(fuzzy.get_scan_progress)
158158
if not ok then
159-
vim.notify('Failed to get scan progress: ' .. result, vim.log.levels.WARN)
159+
vim.notify('Failed to get scan progress: ' .. tostring(result), vim.log.levels.WARN)
160160
return { scanned_files_count = 0, is_scanning = false }
161161
end
162162

@@ -170,7 +170,7 @@ function M.refresh_git_status()
170170

171171
local ok, result = pcall(fuzzy.refresh_git_status)
172172
if not ok then
173-
vim.notify('Failed to refresh git status: ' .. result, vim.log.levels.WARN)
173+
vim.notify('Failed to refresh git status: ' .. tostring(result), vim.log.levels.WARN)
174174
return {}
175175
end
176176

@@ -185,7 +185,7 @@ function M.stop_background_monitor()
185185

186186
local ok, result = pcall(fuzzy.stop_background_monitor)
187187
if not ok then
188-
vim.notify('Failed to stop background monitor: ' .. result, vim.log.levels.WARN)
188+
vim.notify('Failed to stop background monitor: ' .. tostring(result), vim.log.levels.WARN)
189189
return false
190190
end
191191
return result
@@ -199,7 +199,7 @@ function M.wait_for_initial_scan(timeout_ms)
199199

200200
local ok, result = pcall(fuzzy.wait_for_initial_scan, timeout_ms)
201201
if not ok then
202-
vim.notify('Failed to wait for initial scan: ' .. result, vim.log.levels.WARN)
202+
vim.notify('Failed to wait for initial scan: ' .. tostring(result), vim.log.levels.WARN)
203203
return false
204204
end
205205
return result

0 commit comments

Comments
 (0)