@@ -3,6 +3,7 @@ local fs = require("peekstack.util.fs")
33local render = require (" peekstack.ui.render" )
44local diagnostics_ui = require (" peekstack.ui.diagnostics" )
55local keymaps = require (" peekstack.ui.keymaps" )
6+ local notify = require (" peekstack.util.notify" )
67
78local M = {}
89
@@ -127,18 +128,18 @@ function M.create(location, opts)
127128
128129 local ok_buf , fname = pcall (fs .uri_to_fname , location .uri )
129130 if not ok_buf or not fname then
130- vim . notify (" Failed to resolve file: " .. tostring (location .uri ), vim . log . levels . WARN )
131+ notify . warn (" Failed to resolve file: " .. tostring (location .uri ))
131132 return nil
132133 end
133134
134135 local source_bufnr = vim .fn .bufadd (fname )
135136 if source_bufnr == 0 then
136- vim . notify (" Failed to add buffer: " .. fname , vim . log . levels . WARN )
137+ notify . warn (" Failed to add buffer: " .. fname )
137138 return nil
138139 end
139140 local ok_load = pcall (vim .fn .bufload , source_bufnr )
140141 if not ok_load then
141- vim . notify (" Failed to load buffer: " .. fname , vim . log . levels . WARN )
142+ notify . warn (" Failed to load buffer: " .. fname )
142143 return nil
143144 end
144145
@@ -158,7 +159,7 @@ function M.create(location, opts)
158159 line_offset = vp_offset
159160 local ok_lines , lines = pcall (vim .api .nvim_buf_get_lines , source_bufnr , vp_start , vp_end , false )
160161 if not ok_lines then
161- vim . notify (" Failed to read buffer contents: " .. fname , vim . log . levels . WARN )
162+ notify . warn (" Failed to read buffer contents: " .. fname )
162163 return nil
163164 end
164165 vim .api .nvim_buf_set_lines (bufnr , 0 , - 1 , false , lines )
@@ -170,7 +171,7 @@ function M.create(location, opts)
170171 if buffer_mode ~= " source" and vim .api .nvim_buf_is_valid (bufnr ) then
171172 pcall (vim .api .nvim_buf_delete , bufnr , { force = true })
172173 end
173- vim . notify (" Failed to open popup window" , vim . log . levels . WARN )
174+ notify . warn (" Failed to open popup window" )
174175 return nil
175176 end
176177
0 commit comments