getting an error when opening nvim-tree while using cat or lolcat to display the header
Describe the bug i'm getting an error when opening nvim-tree to browse my files when i'm using cat or lolcat to display the header.
To Reproduce Steps to reproduce the behavior:
- use a config like this that uses cat or lolcat to display the output:
require("dashboard").setup(
{
theme = 'hyper',
config = {
packages = {enabled=false},
project = {enable=false},
mru = {limit=20},
footer = {
"",
"Live",
"Not for yourself",
"But for her."
},
},
preview = {
command = "lolcat",
file_path = "~/.config/nvim/lua/_plugins_/karambit-lighter.txt",
file_height = 19,
file_width = 59,
}
}
)
- open up nvim tree
- See error:
Error detected while processing WinResized Autocommands for "*":
Error executing lua callback: ...re/nvim/plugged/dashboard-nvim/lua/dashboard/preview.lua:71: attempt to index field 'col' (a number value)
stack traceback:
...re/nvim/plugged/dashboard-nvim/lua/dashboard/preview.lua:71: in function 'refresh_preview_wincol'
...re/nvim/plugged/dashboard-nvim/lua/dashboard/preview.lua:82: in function <...re/nvim/plugged/dashboard-nvim/lua/dashboard/preview.lua:81>
Press ENTER or type command to continue
and if i press esc and try to use it, the header gets messes up. ik the header is another buffer because i can go to the header and open up another file like this:
but it doesn't change the position properly as you can see:
what terminal is that ? it has to do with not being able to count the columns i cant really get around this because im using neovide
what terminal is that ? it has to do with not being able to count the columns i cant really get around this because im using neovide
it's kitty. btw sorry for the late reply.
i cant reproduce this in my default kitty so my guess is it's something to do with your terminfo or youre missing ncurses so it cant call tput cols maybe (total shot in the dark)
i checked and i do have ncurses installed. i'm using hyprland on arch. maybe it has something to do with how wayland works or something?
i checked and i do have ncurses installed. i'm using hyprland on arch. maybe it has something to do with how wayland works or something?
I'm not sure this is a Wayland thing, I'm getting the exact same problem in Bash on WSL and ZSH on MacOS.
I had the same problem (also using Kitty, but I don't believe this has anything to do with the terminal). The issue looks to be spelled out in the traceback @ingenarel posted in the issue. I patched 3 places in preview.lua of my local version of the plugin and it resolved the issue for me. (My issue was triggered when I opened a side panel, Neo-tree, while dashboard was open.)
I don't understand the logic behind col[false]. It seems col will be always be a number or nil. Maybe this is a typo? At any rate, removing the indexing [false] from lines 61 and 71 resolved the error for me. Although, the header (produced by the lolcat output) remains centered in the resized dashboard window, and bleeds into the sidebar window--but I can live with this.