Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Diagnostic handlers for diagnostics at EOL are inconsistent #34013

Copy link
Copy link
@ddickstein

Description

@ddickstein
Issue body actions

Problem

The diagnostic handler for opening the floating preview window has special handling for diagnostics at the end of the line.

-- If `col` is past the end of the line, show if the cursor is on the last char in the line
local line_length = #api.nvim_buf_get_lines(bufnr, lnum, lnum + 1, true)[1]
--- @param d vim.Diagnostic
diagnostics = vim.tbl_filter(function(d)
return lnum >= d.lnum
and lnum <= d.end_lnum
and (lnum ~= d.lnum or col >= math.min(d.col, line_length - 1))
and ((d.lnum == d.end_lnum and d.col == d.end_col) or lnum ~= d.end_lnum or col < d.end_col)
end, diagnostics)

However, other handlers, such as the underline one, do not do this, which can lead to a surprising user experience (e.g., if you auto-summon the window when on a diagnostic, it will appear in places where there aren't diagnostic indicators). Can the handlers be made consistent?

Nvim version (nvim -v)

0.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.