Skip to content

Commit

Permalink
moved line_width options checking
Browse files Browse the repository at this point in the history
  • Loading branch information
blue-pitaya committed Aug 30, 2023
1 parent 90c070e commit 580ec0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 8 additions & 0 deletions lua/telescope/builtin/__diagnostics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ diagnostics.get = function(opts)
return
end

if type(opts.line_width) == "string" and opts.line_width ~= "full" then
utils.notify("builtin.diagnostics", {
msg = string.format("'%s' is not a valid value for line_width", opts.line_width),
level = "ERROR",
})
return
end

opts.path_display = vim.F.if_nil(opts.path_display, "hidden")
pickers
.new(opts, {
Expand Down
11 changes: 2 additions & 9 deletions lua/telescope/make_entry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1165,15 +1165,8 @@ function make_entry.gen_from_diagnostics(opts)
}
local line_width = vim.F.if_nil(opts.line_width, 0.5)
local line_width_opts = { width = line_width }
if type(line_width) == "string" then
if line_width == "full" then
line_width_opts = {}
else
utils.notify("make_entry.gen_from_diagnostics", {
msg = string.format("'%s' is not a valid value for line_width", line_width),
level = "ERROR",
})
end
if type(line_width) == "string" and line_width == "full" then
line_width_opts = {}
end
local hidden = utils.is_path_hidden(opts)
if not hidden then
Expand Down

0 comments on commit 580ec0d

Please sign in to comment.