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. " 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 " 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 " constantly prefix registration. This can be changed by setting the value of
" g:persist_unnamed_register to 1. " g:persist_unnamed_register to 1.
function! highlight#expand_register(reg) function! highlight#expand_reg(reg)
if !g:persist_unnamed_register && a:reg ==# '"' if !g:persist_unnamed_register && a:reg ==# '"'
return s:active_register return s:active_register
endif endif

View File

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