diff --git a/lua/telescope/command.lua b/lua/telescope/command.lua index 0da84baca8..63d299ab58 100644 --- a/lua/telescope/command.lua +++ b/lua/telescope/command.lua @@ -112,6 +112,9 @@ command.convert_user_opts = function(user_opts) user_opts[key] = eval else -- otherwise return nil (allows split check later) + -- BUG: this doesn't allow things like `preview=false`, where an + -- option supports other types other than the default type + -- (`preview` has a default type of table) user_opts[key] = nil end end diff --git a/lua/telescope/previewers/buffer_previewer.lua b/lua/telescope/previewers/buffer_previewer.lua index ee12453bcb..77322d74ec 100644 --- a/lua/telescope/previewers/buffer_previewer.lua +++ b/lua/telescope/previewers/buffer_previewer.lua @@ -36,6 +36,9 @@ local function defaulter(f, default_opts) default_opts = default_opts or {} return { new = function(opts) + if opts.preview == false then + return false + end if conf.preview == false and not opts.preview then return false end