Skip to content
Discussion options

You must be logged in to vote

Here's how the function looks like now:

---@type table<string, Image>
local images = {}

return {
  "folke/snacks.nvim",
  lazy = false,
  priority = 1000,
  opts = {
    picker = {
      sources = {
        explorer = {
          layout = { preset = "default", preview = true },
          auto_close = true,
        },
        files = {

          ---@param ctx snacks.picker.preview.ctx
          preview = function(ctx)
            local check_is_image = function(fileName)
              local image_extensions = { "png", "jpg", "webp" } -- Supported image formats
              local split_path = vim.split(fileName:lower(), ".", { plain = true })
              local extension = split_path[#s…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@folke
Comment options

@eslam-allam
Comment options

@eslam-allam
Comment options

Answer selected by eslam-allam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants