A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/a8e2c45b9462b740f22305397342b96586b88681 below:

make `open_float` respect global diagnostic options … · neovim/neovim@a8e2c45 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+12

-11

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+12

-11

lines changed Original file line number Diff line number Diff line change

@@ -1224,6 +1224,18 @@ function M.open_float(opts, ...)

1224 1224 1225 1225

opts = opts or {}

1226 1226

bufnr = get_bufnr(bufnr or opts.bufnr)

1227 + 1228 +

do

1229 +

-- Resolve options with user settings from vim.diagnostic.config

1230 +

-- Unlike the other decoration functions (e.g. set_virtual_text, set_signs, etc.) `open_float`

1231 +

-- does not have a dedicated table for configuration options; instead, the options are mixed in

1232 +

-- with its `opts` table which also includes "keyword" parameters. So we create a dedicated

1233 +

-- options table that inherits missing keys from the global configuration before resolving.

1234 +

local t = global_diagnostic_options.float

1235 +

local float_opts = vim.tbl_extend("keep", opts, type(t) == "table" and t or {})

1236 +

opts = get_resolved_options({ float = float_opts }, nil, bufnr).float

1237 +

end

1238 + 1227 1239

local scope = ({l = "line", c = "cursor", b = "buffer"})[opts.scope] or opts.scope or "line"

1228 1240

local lnum, col

1229 1241

if scope == "line" or scope == "cursor" then

@@ -1242,17 +1254,6 @@ function M.open_float(opts, ...)

1242 1254

error("Invalid value for option 'scope'")

1243 1255

end

1244 1256 1245 -

do

1246 -

-- Resolve options with user settings from vim.diagnostic.config

1247 -

-- Unlike the other decoration functions (e.g. set_virtual_text, set_signs, etc.) `open_float`

1248 -

-- does not have a dedicated table for configuration options; instead, the options are mixed in

1249 -

-- with its `opts` table which also includes "keyword" parameters. So we create a dedicated

1250 -

-- options table that inherits missing keys from the global configuration before resolving.

1251 -

local t = global_diagnostic_options.float

1252 -

local float_opts = vim.tbl_extend("keep", opts, type(t) == "table" and t or {})

1253 -

opts = get_resolved_options({ float = float_opts }, nil, bufnr).float

1254 -

end

1255 - 1256 1257

local diagnostics = get_diagnostics(bufnr, opts, true)

1257 1258 1258 1259

if scope == "line" then

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4