jinh0 / eyeliner.nvim

👀 Move faster with unique f/F indicators.
463 stars 15 forks source link

Error when highlight color is not in hexadecimal #10

Closed Creator54 closed 2 years ago

Creator54 commented 2 years ago

building with this plugin fails for me :cry:

image

jinh0 commented 2 years ago

Hey @Creator54 , I think I figured out what the problem is. It doesn't seem to be a problem with Neovim 0.7.0 (I am on the same version), but it's a problem with how I calculate the color to use for eyeliner.nvim.

The error

13 is not a valid color

is because I expect the highlight color to be hexadecimal, as in starting with # . That's pretty stupid of me. I'll fix this issue ASAP.

Thanks for making the post!

jinh0 commented 2 years ago

Hey @Creator54 , can you check if this issue's been fixed with the newest commit 3a087063493b3187a8dfe4df54481fceaeeb644b ? If not, can you send me the colorscheme you use?

Creator54 commented 2 years ago

Hey @Creator54 , can you check if this issue's been fixed with the newest commit 3a08706 ? If not, can you send me the colorscheme you use?

thanks , it's working now. though I am still missing the highlights(colorscheme onedark).

Thu-2022-07-21-6

jinh0 commented 2 years ago

Hmm, can you tell me the output for the following commands?

:lua vim.notify(vim.inspect(vim.api.nvim_get_hl_by_name('Define', true)))

and

:lua vim.notify(vim.inspect(vim.api.nvim_get_hl_by_name('Constant', true)))

.

Also, for the meanwhile, you can manually set the colors, using the information in the README, for example:

vim.api.nvim_set_hl(0, 'EyelinerPrimary', { fg = '#eeff00', bold = true, underline = true })
vim.api.nvim_set_hl(0, 'EyelinerSecondary', { fg = '#ffffff', underline = true })
Creator54 commented 2 years ago

Hmm, can you tell me the output for the following commands?

:lua vim.notify(vim.inspect(vim.api.nvim_get_hl_by_name('Define', true)))

{
foreground = 13007069
}

and

:lua vim.notify(vim.inspect(vim.api.nvim_get_hl_by_name('Constant', true)))

{
foreground = 5682882
}

Also, for the meanwhile, you can manually set the colors, using the information in the README, for example:

vim.api.nvim_set_hl(0, 'EyelinerPrimary', { fg = '#eeff00', bold = true, underline = true })
vim.api.nvim_set_hl(0, 'EyelinerSecondary', { fg = '#ffffff', underline = true })

Could you share a vimscript approch ?

jinh0 commented 2 years ago

{ foreground = 13007069 }

Thanks! I'll check it out.

Could you share a vimscript approch ?

In Vimscript, you can manually set the colors with

highlight EyelinerPrimary guifg=#eeff00,gui=underline,bold
highlight EyelinerSecondary gui=underline

:h highlight-args provides more information about highlight options.

Creator54 commented 2 years ago

In Vimscript, you can manually set the colors with

highlight EyelinerPrimary guifg=#eeff00,gui=underline,bold
highlight EyelinerSecondary gui=underline

Colors still don't seem to work !

jinh0 commented 2 years ago

Hey @Creator54 , turns out the Vimscript commands I sent you had a typo! That's why it wasn't working!

highlight EyelinerPrimary guifg=#000000 gui=underline,bold
highlight EyelinerSecondary gui=underline

There should be a space between guifg and gui.

You can see it working here:

https://user-images.githubusercontent.com/40512164/180618667-23a5da5b-1561-42fa-a1c7-7e874591b65d.mov

Thanks for your patience, hopefully this fixes it, once and for all!

Creator54 commented 2 years ago

Hey @Creator54 , turns out the Vimscript commands I sent you had a typo! That's why it wasn't working!

highlight EyelinerPrimary guifg=#000000 gui=underline,bold
highlight EyelinerSecondary gui=underline

There should be a space between guifg and gui.

You can see it working here: Screen.Recording.2022-07-23.at.2.40.35.PM.mov

Thanks for your patience, hopefully this fixes it, once and for all!

Hi, I did try that, still am not able to figure out why it won't work for me. even did try with different themes,disabling picom too. here's a screenrecord and am also attaching my nvim-config if it helps. thanks. Sun-2022-07-24-6

jinh0 commented 2 years ago

Not sure if you're using gui colors, in which case you might wanna try

hi EyelinerPrimary guifg=#000000 ctermfg=0

Also, you need to specify what color you want when you change your colorscheme:

autocmd ColorScheme * :highlight EyelinerPrimary guifg=#000000 ctermfg=0
Creator54 commented 2 years ago

Not sure if you're using gui colors, in which case you might wanna try

hi EyelinerPrimary guifg=#000000 ctermfg=0

Also, you need to specify what color you want when you change your colorscheme:

autocmd ColorScheme * :highlight EyelinerPrimary guifg=#000000 ctermfg=0

tried but couldn't get it to work . link to my config if you wish to take a look : https://github.com/Creator54/nixos-cfg/blob/a859f6a7d765060367745f18add7e382273990f4/pkgs/nvim.nix#L32-L121

switched to quick-scope and it works as expected without any issues. so will be switching to quick-scope now, also this projects goal is aimed at lua people and it works for them + I am the only one facing this so feel free to close this issue or If you need any more debugging/logs will be happy to provide.

thanks for all the help and referring quick-scope in the readme.

jinh0 commented 2 years ago

Sorry this plugin caused so many issues! quick-scope has worked for me for a long time, it's very good. I'll close this issue for now, thanks for trying my plugin out :)