A RetroSearch Logo

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

Search Query:

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

clamp diagnostics on negative line numbers (#16496) · neovim/neovim@254c22a · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+1

-1

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+1

-1

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

@@ -386,7 +386,7 @@ local function get_diagnostics(bufnr, opts, clamp)

386 386

if not opts.lnum or d.lnum == opts.lnum then

387 387

if clamp and vim.api.nvim_buf_is_loaded(b) then

388 388

local line_count = buf_line_count[b] - 1

389 -

if (d.lnum > line_count or d.end_lnum > line_count) then

389 +

if (d.lnum > line_count or d.end_lnum > line_count or d.lnum < 0 or d.end_lnum < 0) then

390 390

d = vim.deepcopy(d)

391 391

d.lnum = math.max(math.min(d.lnum, line_count), 0)

392 392

d.end_lnum = math.max(math.min(d.end_lnum, line_count), 0)

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