Created
January 14, 2026 12:00
-
-
Save lina-bh/65a3ee38b3c17ead9e7be7b7fc215850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vim.api.nvim_create_autocmd("CursorHold", { | |
| callback = function() | |
| local lnum, col = unpack(vim.api.nvim_win_get_cursor(0)) | |
| local diagnostics = vim.diagnostic.get(0, { lnum = lnum - 1 }) | |
| if #diagnostics > 0 then | |
| vim.api.nvim_echo({ | |
| { | |
| vim | |
| .iter(diagnostics) | |
| :filter(function(d) | |
| return col >= d.col and col < d.end_col | |
| end) | |
| :map(function(d) | |
| return d.message | |
| end) | |
| :join("\n"), | |
| "WarningMsg", | |
| }, | |
| }, false, {}) | |
| end | |
| end, | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment