Skip to content
Discussion options

You must be logged in to vote

This is the easiest solution you can use without having to create your own preview — but you'll probably see why it's not the best-looking approach:

config = function(_, opts)
  require('snacks').setup(opts)

  local supports_file = require('snacks.image').supports_file
  Snacks.image.supports_file = function(file)
    if not Snacks.image.config.enabled then
      return false
    end
    return supports_file(file)
  end
end,
opts = {
  images = {},                  -- Snacks.image.config.enabled == true
  images = nil,                 -- Snacks.image.config.enabled == false
  images = { enabled = true },  -- Snacks.image.config.enabled == true
  images = { enabled = false }, -- Snacks.im…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@drowning-cat
Comment options

@drowning-cat
Comment options

@cmdrrobin
Comment options

@drowning-cat
Comment options

Answer selected by cmdrrobin
@cmdrrobin
Comment options

@cmdrrobin
Comment options

@cmdrrobin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants