Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim.diagnostic.open_float opens window one character beyond end of diagnostic #21958

Open
ddickstein opened this issue Jan 23, 2023 · 0 comments
Labels
bug issues reporting wrong behavior diagnostic

Comments

@ddickstein
Copy link
Contributor

Describe the bug

vim.diagnostic.open_float works one column beyond the end of the diagnostic. I think it's because this d.end_col >= col should be d.end_col > col since end_col is exclusive. But reasoning about off-by-one errors is hard so someone more familiar with the code should think about whether that fix will present other issues before applying it.

Steps to reproduce

Call vim.diagnostic.open_float one column past the diagnostic and observe that the window opens.

Expected behavior

vim.diagnostic.open_float should only work if called inside the diagnostic.

Neovim version (nvim -v)

0.7.0

Vim (not Nvim) behaves the same?

N/A

Operating system/version

CentOS 7.9

Terminal name/version

xfce4-terminal 0.8.10 (Xfce 4.16)

$TERM environment variable

tmux-256color

Installation

system package manager

@ddickstein ddickstein added the bug issues reporting wrong behavior label Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior diagnostic
Projects
None yet
Development

No branches or pull requests

2 participants