goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.92k stars 113 forks source link

Don't add spaces to center on lines with empty content #57

Closed augustocdias closed 2 years ago

augustocdias commented 2 years ago

In my setup I like to highlight trailing spaces in lines so I can easily remove them when I accidentally add, and this cause alpha to behave like the image bellow when there are lines with empty content (the light yellow ones).

image

I was wondering if its possible for the plugin to check if the current line being printed is empty and if so just break the line instead of adding the spaces to center it.

goolord commented 2 years ago

are you using list? you can add set nolist to a filetype autocommand or in opts.setup

it's possible to do as your suggesting but i would prefer not to for various reasons

goolord commented 2 years ago

actually, nolist is already set, so i'm not sure how you're even rendering those highlights. whatever plugin/code you're using, you just disable it when ft=alpha

augustocdias commented 2 years ago

It is not a plug-in. It is simply calling highlight on what matches a regex

vim.cmd('highlight ExtraWhitespace ctermbg=darkcyan guibg=darkcyan')
vim.cmd('match ExtraWhitespace /\\s\\+$\\|\\t/')
goolord commented 2 years ago

yeah, then i would suggest setting up opts.setup or a filetype autocmd to call highlight ExtraWhitespace NONE for alpha

goolord commented 2 years ago

hopefully i'm not coming across as rude, i just don't want to support edge cases for what are ultimately user configuration problems. it's a sisyphean task, tbh. it's just a side effect of trying to jerry-rig a gui out of a program that was only really ever designed to edit text files. stuff like this is why i have support for calling your own code on setup (in opts.setup) and why alpha has its own filetype (so you can run code on setup with autocmd FileType alpha)

augustocdias commented 2 years ago

I understand. No worries.