Closed andis-sprinkis closed 1 year ago
Looking into this further now.
I found a way to explicitly trigger it on my setup.
I create and open a file
#!/usr/bin/env sh
\\\
echo "a"
I make sure that the last line in the text is at over half the vertical height of the window.
I add and remove slash on line 2. Then I press Esc and call :split
.
Then the error occurs.
It seems to occur only when the newly creates split at the bottom obfuscates one of the lines that would be processed by the highlighting, in this case echo "a"
, where echo
would be highlighted.
I'll disable the plugins and options customization to see the minimal setup I can replicate this on.
Minimal config. has arrived
vim.opt.splitkeep = 'screen' -- bug replication: could not replicate the bug without setting this exact value
vim.opt.splitbelow = true -- bug replication: to obfuscate the last part of the open file via :split
vim.g.loaded_netrwPlugin = 0
vim.opt.backup = false
vim.opt.swapfile = false
vim.opt.writebackup = false
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
if vim.fn.confirm("Download and initialize the configured plugins?", "&Yes\n&No", 2) == 2 then return end
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup(
{
{
'williamboman/mason.nvim',
config = function()
local lsp_servers = {
'bashls', -- bug replication: issue does not occur if no language server is initialized
}
local on_attach = function(client, bufnr)
require('illuminate').on_attach(client)
end -- bug replication: LEAVING IN THIS V1 METHOD CAUSES THE ERR. ON BUF. SPLIT W/ THIS CFG.
local function make_config()
return {
on_attach = on_attach,
}
end
require("mason").setup()
require("mason-lspconfig").setup({ ensure_installed = lsp_servers })
local lspconfig = require("lspconfig")
require("mason-lspconfig").setup_handlers({
function(server_name)
lspconfig[server_name].setup(make_config())
end,
})
end,
dependencies = {
'neovim/nvim-lspconfig',
'williamboman/mason-lspconfig.nvim',
'RRethy/vim-illuminate',
}
}
},
{
performance = {
rtp = {
disabled_plugins = {
"gzip",
"matchparen",
"netrwPlugin",
"rplugin",
"spellfile",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
}
}
)
Not calling the V1 method require('illuminate').on_attach(client)
mitigates, and, I guess, fixes this issue on the user side.
Hey, require('illuminate').on_attach(client)
isn't supported anymore so this isn't going to get a direct fix. Since your most recent comment says it's fixed I'm going to close the issue. Behaviour should remain the same (and in many cases better) with the newer setup instead of the old on_attach.
Describe the bug I occasionally get this same error when creating a populated split window by seemingly any command.
To Reproduce Steps to reproduce the behavior (include minimal
init.vim
or.vimrc
):lua vim.diagnostic.setloclist()
(assigned to<leader>q
):Gstatus
command (this one is not a loclist)Note Omitting a minimal
init.vim
/init.lua
/.vimrc
will likely result in the issue being closed without explanation.Without investigating vim-illuminate code and knowing the issue, I do not know what would be the minimum config required to reproduce this, as it only happens on occasion (3-5 times a day).
This is my full config at the moment of writing this
Output from
:IlluminateDebug
Expected behavior A vertical split window to be created and populated by vim diagnostics loclist content or by respective plugin (vim-fugitive, fzf-lua) content.
Instead of:
This error sowing up in the status area
And due to error the respective split window gets created, but populated only by the previously focused open file window buffer, rather than the LSP diagnostics loclist content or plugin content.EDIT: that was incorrect, the split window content does get populated with the LSP debug / plugin content, even with the error occurring.Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.