inside / vim-search-pulse

Easily locate the cursor after a search
127 stars 8 forks source link

Missing argument `ctermbg` error #18

Closed fortes closed 7 years ago

fortes commented 7 years ago

Hi there, I get the following error when using a minimal setup:

Error detected while processing function search_pulse#Pulse[13]..search_pulse#P
ulseCursorLine[44]..<SNR>71_SetCursorLineColor:                                
line    1:                                                                     
E417: missing argument: ctermbg=  

I can reproduce this with the following .vimrc (uses vim-plug, but that should not matter):

call plug#begin()
Plug 'inside/vim-search-pulse'
call plug#end()

Here is my system info (I run vim in the terminal):

NVIM 0.1.6
Build type: None
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-iX7_MI/neovim-0.1.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DDISABLE_LOG -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1  -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/build/neovim-iX7_MI/neovim-0.1.6/build/config -I/build/neovim-iX7_MI/neovim-0.1.6/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim-iX7_MI/neovim-0.1.6/build/src/nvim/auto -I/build/neovim-iX7_MI/neovim-0.1.6/build/include
Compiled by pkg-vim-maintainers@lists.alioth.debian.org

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

The plugin works fine in my normal setup, but breaks once I tried to move to a different colorscheme (I use hybrid normally)

Thanks for the great plugin!

fortes commented 7 years ago

(Originally I thought this was due to base16, but I removed that colorscheme and still get this error)

inside commented 7 years ago

Hi fortes,

I can't reproduce but can you try it again with this patch applied where the bundle is installed?

Thanks!

diff --git a/autoload/search_pulse.vim b/autoload/search_pulse.vim
index cb9839b..1e1a329 100644
--- a/autoload/search_pulse.vim
+++ b/autoload/search_pulse.vim
@@ -42,7 +42,7 @@ func! s:Initialize()
   let s:highlight_arg = gui_running ? 'guibg' : 'ctermbg'
   let s:oldc = synIDattr(synIDtrans(hlID('CursorLine')), 'bg')

-  if s:oldc == -1
+  if s:oldc == -1 || s:oldc == ''
     let s:oldc = 'NONE'
   endif
fortes commented 7 years ago

Just tested and that works! Thanks for fixing!

inside commented 7 years ago

You're welcome! I just pushed this fix on the master branch. You can remove your local change and update the plugin with :PlugUpdate vim-search-pulse.