yamatsum / nvim-cursorline

A plugin for neovim that highlights cursor words and lines
MIT License
412 stars 29 forks source link

Bug: Error detected while processing CursorMoved Autocommands for "*" #5

Open pocco81 opened 3 years ago

pocco81 commented 3 years ago

Situation

Right after installation I got an error that would reappear whenever I tried to move the cursor

Error Message

image

Environment

Lua: ==> lua-5.3.6 ==> luarocks-3.6.0 NVIM v0.5.0-dev+1233-g82ac44d01 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Plugin manager: Packer.nvim

knowler commented 3 years ago

I was having this same issue and I discovered it was because I had the following set in my Neovim config which allows me to have a translucent background for my editor.

highlight Normal guibg=NONE ctermbg=NONE

Removing it resolved my issues. It would be nice if there was some way to support this though.

Shatur commented 3 years ago

I fixed it in #8. Setting CursorLineNr and CursorLine is unnecessary.

Chaitanyabsprip commented 3 years ago

dealing with the same issue

yamatsum commented 3 years ago

I don't know because I don't use translucency, but I'm waiting for PR if needed!

VedantParanjape commented 3 years ago

@yamatsum How do I solve this ? I still get this error

Terrahop commented 3 years ago

Was having the same issue, setting guibg to #00000 seemed to have fixed it for me

hi Normal ctermbg=NONE guibg=#00000
ofsaleem commented 3 years ago

Was having the same issue, setting guibg to #00000 seemed to have fixed it for me

hi Normal ctermbg=NONE guibg=#00000

didn't help me :( still same complaint:

Error detected while processing CursorMoved Autocommands for "*": E5108: Error executing lua ...fig/nvim/plugged/nvim-cursorline/lua/nvim-cursorline.lua:59: Vim(highlight):E417: missing argument: guibg=

EDIT: actually it started working, i had a require'nvim-cursorline' line and when i removed that and ran :PlugUpdate again it started working, transparency is kept (except for the highlighted line which is okay i guess) but words are underlined and after waiting for a bit the line the cursor is at is highlighted.

yamatsum commented 3 years ago

@Pocco81 @knowler @Shatur @Chaitanyabsprip @VedantParanjape @Terrahop @ofsaleem cursoropt has been merged https://github.com/neovim/neovim/issues/13356#event-5101683629 So I created a branch that takes advantage of this feature (but this requires neovim nightly) https://github.com/yamatsum/nvim-cursorline/tree/nightly Could you please verify if this branch fixes the bug?

ofsaleem commented 3 years ago

that seems to have fixed it for me, i added my require line back and things broke, switched to nightly nvim-cursorline and no error messages, switched back to main and error messages came back. so seems like it did the trick. using brew's neovim-nightly

Zamachi commented 3 years ago

Hi guys, I have tried this plugin from both main and nightly branch, I'm using Neovim 0.5 on Windows 10 and I still get this issue(regardless of whether I use the "require" function).

The only time it "appears" to work is whenever the theme I use doesn't add some sort of transparency? So, Catpuccino with transparency off works, but Moonlight theme straight out breaks the Neovim ( since I'm on Windows, the GUI is from Qt, although it seems I should change that too...), and that is only with the non-night build, with night build installed my Neovim crashes.

The messages displayed are practically the same as in the original post, so no need to repost the :messages.

haras-unicorn commented 2 years ago

@yamatsum was this not fixed in #11? I found the plugin pretty sweet so I added a pull request for a separate issue but I could not reproduce this one.

hyper-jarrod commented 2 years ago

I had the same error but from a different cause. In my neovim config I have code that highlights trailing whitespace.

" Highlights trailing whitespace
   highlight ExtraWhitespace ctermbg=red guibg=red
   match ExtraWhitespace /\s\+$/
   autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
   autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
   autocmd InsertLeave * match ExtraWhitespace /\s\+$/
   autocmd BufWinLeave * call clearmatches()

The last line was causing the issue so I have removed it. Whitespace highlight still seems to be working as expected.

autocmd BufWinLeave * call clearmatches()