1
Fork 0

ExpandRegister to ExpandReg and reformat.

master
Joshua Potter 2017-05-23 21:35:51 -07:00
parent aa5e54a32e
commit c81985c519
2 changed files with 18 additions and 13 deletions

View File

@ -14,7 +14,7 @@
" ------------------------------------------------------------------------------
" The h_register currently active. This defaults to the unnamed register.
let s:active_register = "\""
let s:active_register = "1"
" s:registry :: { String : { String : Match } } {{{2
@ -37,7 +37,7 @@ let s:registry = {}
" constantly prefix registration. This can be changed by setting the value of
" g:persist_unnamed_register to 1.
function! highlight#expand_register(reg)
function! highlight#expand_reg(reg)
if !g:persist_unnamed_register && a:reg ==# '"'
return s:active_register
endif

View File

@ -60,27 +60,32 @@ endif
" Append Searches
noremap <Plug>HRegistry_AppendToSearch
\ :call highlight#append_to_search(highlight#expand_register(v:register), highlight#expand_flag('c'))<Bar>
\ call highlight#count_pattern(highlight#expand_flag('c'))<CR>
\ :call highlight#append_to_search(highlight#expand_reg(v:register),
\ highlight#expand_flag('c'))
\ <Bar>call highlight#count_pattern(highlight#expand_flag('c'))<CR>
noremap <Plug>HRegistry_GAppendToSearch
\ :call highlight#append_to_search(highlight#expand_register(v:register), highlight#expand_flag('g'))<Bar>
\ call highlight#count_pattern(highlight#expand_flag('g'))<CR>
\ :call highlight#append_to_search(highlight#expand_reg(v:register),
\ highlight#expand_flag('g'))
\ <Bar>call highlight#count_pattern(highlight#expand_flag('g'))<CR>
noremap <Plug>HRegistry_VisualAppendToSearch
\ :call highlight#append_to_search(highlight#expand_register(v:register), highlight#expand_flag('v'))<Bar>
\ call highlight#count_pattern(highlight#expand_flag('v'))<CR>
\ :call highlight#append_to_search(highlight#expand_reg(v:register),
\ highlight#expand_flag('v'))
\ <Bar>call highlight#count_pattern(highlight#expand_flag('v'))<CR>
" Remove Searches
noremap <Plug>HRegistry_RemoveFromSearch
\ :call highlight#remove_from_search(highlight#expand_register(v:register), highlight#expand_flag('c'))<CR>
\ :call highlight#remove_from_search(highlight#expand_reg(v:register),
\ highlight#expand_flag('c'))<CR>
noremap <Plug>HRegistry_VisualRemoveFromSearch
\ :call highlight#remove_from_search(highlight#expand_register(v:register), highlight#expand_flag('v'))<CR>
\ :call highlight#remove_from_search(highlight#expand_reg(v:register),
\ highlight#expand_flag('v'))<CR>
" Other Modifications
noremap <Plug>HRegistry_ClearRegister
\ :call highlight#clear_register(highlight#expand_register(v:register))<Bar>
\ call highlight#activate_register(highlight#expand_register(v:register))<CR>
\ :call highlight#clear_register(highlight#expand_reg(v:register))<Bar>
\ call highlight#activate_register(highlight#expand_reg(v:register))<CR>
noremap <Plug>HRegistry_ActivateRegister
\ :call highlight#activate_register(highlight#expand_register(v:register))<CR>
\ :call highlight#activate_register(highlight#expand_reg(v:register))<CR>
noremap <Plug>HRegistry_CountLastSeen
\ :call highlight#count_pattern(highlight#expand_flag('c'))<CR>