diff --git a/README.md b/README.md index f6211d9..012c129 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ let g:ruby_hl_lvar_hl_group = 'RubyLocalVariable' " Default: 1 let g:ruby_hl_lvar_auto_enable = 0 +" g:ruby_hl_lvar_hl_group highlight priority +" Default: 0 +let g:ruby_hl_lvar_highlight_priority = 0 + " If you wish to control the plugin manually, map these functions. nmap he (ruby_hl_lvar-enable) nmap hd (ruby_hl_lvar-disable) diff --git a/autoload/ruby_hl_lvar.vim b/autoload/ruby_hl_lvar.vim index 2e342f4..647b53d 100644 --- a/autoload/ruby_hl_lvar.vim +++ b/autoload/ruby_hl_lvar.vim @@ -59,14 +59,14 @@ function! s:redraw_window() let i = 0 while i < size let poses = b:ruby_hl_lvar_match_poses[i : i + 7] - let m = matchaddpos(g:ruby_hl_lvar_hl_group, poses, 0) + let m = matchaddpos(g:ruby_hl_lvar_hl_group, poses, g:ruby_hl_lvar_highlight_priority) call add(w:ruby_hl_lvar_match_ids, m) let i += 8 endwhile endif else if get(b:, 'ruby_hl_lvar_match_pattern', '') != '' - let w:ruby_hl_lvar_match_id = matchadd(g:ruby_hl_lvar_hl_group, b:ruby_hl_lvar_match_pattern, 0) + let w:ruby_hl_lvar_match_id = matchadd(g:ruby_hl_lvar_hl_group, b:ruby_hl_lvar_match_pattern, g:ruby_hl_lvar_highlight_priority) endif endif diff --git a/plugin/ruby_hl_lvar.vim b/plugin/ruby_hl_lvar.vim index 8893923..a2a6bc2 100644 --- a/plugin/ruby_hl_lvar.vim +++ b/plugin/ruby_hl_lvar.vim @@ -12,6 +12,9 @@ let g:ruby_hl_lvar_auto_enable = let g:ruby_hl_lvar_show_warnings = \ get(g:, 'ruby_hl_lvar_show_warnings', 0) +let g:ruby_hl_lvar_highlight_priority = + \ get(g:, 'ruby_hl_lvar_highlight_priority', 0) + augroup ruby_hl_lvar autocmd! autocmd Filetype * call Ruby_hl_lvar_filetype()