File tree 1 file changed +8
-1
lines changed
lua/neo-tree/sources/common
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 273
273
274
274
--- @param winid number
275
275
--- @param bufnr number
276
+ --- @return Image[] | false result Images if the buffer was successfully hijacked , otherwise false
276
277
local function try_load_image_nvim_buf (winid , bufnr )
278
+ -- notify only image.nvim to let it try and hijack
279
+ vim .opt .eventignore :remove (" BufWinEnter" )
280
+ vim .api .nvim_win_call (winid , function ()
281
+ vim .api .nvim_exec_autocmds (" BufWinEnter" , { group = " image.nvim" , buffer = bufnr })
282
+ end )
283
+ vim .opt .eventignore :append (" BufWinEnter" )
277
284
if vim .bo [bufnr ].filetype ~= " image_nvim" then
278
285
return false
279
286
end
@@ -283,7 +290,7 @@ local function try_load_image_nvim_buf(winid, bufnr)
283
290
log .debug (" You'll need to install image.nvim to use this command: " .. image_nvim_url )
284
291
return false
285
292
end
286
- return mod .hijack_buffer ( vim . api . nvim_buf_get_name ( bufnr ), winid , bufnr )
293
+ return mod .get_images ({ buffer = bufnr , window = winid } )
287
294
end
288
295
289
296
--- Set the buffer in the preview window without executing BufEnter or BufWinEnter autocommands.
You can’t perform that action at this time.
0 commit comments