From e6bf71a53a147311a31f69b4c4b0299f91eddeab Mon Sep 17 00:00:00 2001 From: Tom McDonald Date: Sat, 14 Feb 2015 10:38:48 -0500 Subject: [PATCH] Add :XchangeClear, deprecate :ExchangeClear References #28, #29 --- plugin/exchange.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin/exchange.vim b/plugin/exchange.vim index 4b659be..8717ac1 100644 --- a/plugin/exchange.vim +++ b/plugin/exchange.vim @@ -98,12 +98,15 @@ function! s:exchange_set(type, ...) endif endfunction -function! s:exchange_clear() +function! s:exchange_clear(...) unlet! b:exchange if exists('b:exchange_matches') call s:highlight_clear(b:exchange_matches) unlet b:exchange_matches endif + if a:0 + echohl WarningMsg | echo ":ExchangeClear will be deprecated in favor of :XchangeClear" | echohl None + endif endfunction function! s:save_reg(name) @@ -225,7 +228,8 @@ vnoremap (Exchange) :call exchange_set(visualmode(), 1) nnoremap (ExchangeClear) :call exchange_clear() nnoremap (ExchangeLine) :set opfunc=exchange_setg@_ -command! ExchangeClear call s:exchange_clear() +command! ExchangeClear call s:exchange_clear(1) +command! XchangeClear call s:exchange_clear() if exists('g:exchange_no_mappings') finish