Rename three commands, deprecate their old names (#887)

The following commands have been renamed to better describe their
function and avoid confusion.
:VimwikiDeleteLink → :VimwikiDeletePage
:VimwikiRenameLink → :VimwikiRenamePage
:VimwikiGenerateTags → :VimwikiGenerateTagLinks (was already renamed in 3b5537f)

Calling the old commands still works but displays a warning message.
This commit is contained in:
Michael F. Schönitzer 2020-05-24 23:49:28 +02:00 committed by GitHub
parent 57dc48d686
commit 1eb74dcf2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 18 deletions

View File

@ -2379,6 +2379,11 @@ function! vimwiki#base#search(search_pattern) abort
endtry endtry
endfunction endfunction
function! vimwiki#base#deprecate(old, new) abort
echohl WarningMsg
echo a:old 'is deprecated and will be removed in future versions, use' a:new 'instead.'
echohl None
endfunction
" ------------------------------------------------------------------------- " -------------------------------------------------------------------------
" Load syntax-specific Wiki functionality " Load syntax-specific Wiki functionality

View File

@ -387,13 +387,13 @@ MAP MODE
*vimwiki_<Leader>wd* *vimwiki_<Leader>wd*
<Leader>wd n Delete wiki page you are in. <Leader>wd n Delete wiki page you are in.
Maps to |:VimwikiDeleteLink|. Maps to |:VimwikiDeleteFile|.
Remap command: `<Plug>VimwikiDeleteLink` Remap command: `<Plug>VimwikiDeleteFile`
*vimwiki_<Leader>wr* *vimwiki_<Leader>wr*
<Leader>wr n Rename wiki page you are in. <Leader>wr n Rename wiki page you are in.
Maps to |:VimwikiRenameLink|. Maps to |:VimwikiRenameFile|.
Remap command: `<Plug>VimwikiRenameLink` Remap command: `<Plug>VimwikiRenameFile`
*vimwiki_=* *vimwiki_=*
= n Add header level. Create if needed. = n Add header level. Create if needed.
@ -793,10 +793,10 @@ Vimwiki file.
Supports |cmdline-completion| for link name. If name is not specified, a Supports |cmdline-completion| for link name. If name is not specified, a
prompt will be shown. prompt will be shown.
*:VimwikiDeleteLink* *:VimwikiDeleteFile*
Delete the wiki page you are in. Delete the wiki page you are in.
*:VimwikiRenameLink* *:VimwikiRenameFile*
Rename the wiki page you are in. Rename the wiki page you are in.
*:VimwikiNextTask* *:VimwikiNextTask*
@ -3506,7 +3506,7 @@ https://github.com/vimwiki-backup/vimwiki/issues.
2.5 (in progress)~ 2.5 (in progress)~
New:~ New:~
* PR #787: |:VimwikiRenameLink| works for all directories: even * PR #787: |:VimwikiRenameFile| works for all directories: even
wiki_root/diary/2019-12-11.md if current file is wiki_root/dir1/file.md. wiki_root/diary/2019-12-11.md if current file is wiki_root/dir1/file.md.
* Issue #764: fenced code blocks are properly supported for markdown * Issue #764: fenced code blocks are properly supported for markdown
syntax i.e. more than 3 backticks, adds tilde support. syntax i.e. more than 3 backticks, adds tilde support.
@ -3576,6 +3576,11 @@ New:~
* PR #857: Make default template responsive * PR #857: Make default template responsive
* PR #879: Generate links when diary & wiki dir are the same * PR #879: Generate links when diary & wiki dir are the same
Changed:~
* Issue #796: Rename |:VimwikiGenerateTags| to |:VimwikiGenerateTagLinks|
* Issue #638: Rename |:VimwikiDeleteLink| to |:VimwikiDeleteFile|
* Issue #638: Rename |:VimwikiRenameLink| to |:VimwikiRenameFile|
Removed:~ Removed:~
* PR #698: Remove awa check triggering silent file edits. * PR #698: Remove awa check triggering silent file edits.
* Options g:vimwiki_use_mouse and g:vimwiki_table_mappings. These are * Options g:vimwiki_use_mouse and g:vimwiki_table_mappings. These are
@ -3585,7 +3590,6 @@ Removed:~
Fixed:~ Fixed:~
* Issue #90: VimwikiRenameLink doesn't update links in diary. * Issue #90: VimwikiRenameLink doesn't update links in diary.
* Issue #796: Rename |:VimwikiGenerateTags| to |:VimwikiGenerateTagLinks|
* Issue #790: Allow tags before a header with markdown syntax. * Issue #790: Allow tags before a header with markdown syntax.
* Issue #779: Vimwiki tags file meets ctags standard. * Issue #779: Vimwiki tags file meets ctags standard.
* Issue #781: Compatablity fixes for older versions of Vim. * Issue #781: Compatablity fixes for older versions of Vim.

View File

@ -242,8 +242,14 @@ command! -buffer VimwikiTOC call vimwiki#base#table_of_contents(1)
command! -buffer VimwikiNextTask call vimwiki#base#find_next_task() command! -buffer VimwikiNextTask call vimwiki#base#find_next_task()
command! -buffer VimwikiNextLink call vimwiki#base#find_next_link() command! -buffer VimwikiNextLink call vimwiki#base#find_next_link()
command! -buffer VimwikiPrevLink call vimwiki#base#find_prev_link() command! -buffer VimwikiPrevLink call vimwiki#base#find_prev_link()
command! -buffer VimwikiDeleteLink call vimwiki#base#delete_link() command! -buffer VimwikiDeleteFile call vimwiki#base#delete_link()
command! -buffer VimwikiRenameLink call vimwiki#base#rename_link() command! -buffer VimwikiDeleteLink
\ call vimwiki#base#deprecate("VimwikiDeleteLink", "VimwikiDeleteFile") |
\ call vimwiki#base#delete_link()
command! -buffer VimwikiRenameFile call vimwiki#base#rename_link()
command! -buffer VimwikiRenameLink
\ call vimwiki#base#deprecate("VimwikiRenameLink", "VimwikiRenameFile") |
\ call vimwiki#base#rename_link()
command! -buffer VimwikiFollowLink call vimwiki#base#follow_link('nosplit', 0, 1) command! -buffer VimwikiFollowLink call vimwiki#base#follow_link('nosplit', 0, 1)
command! -buffer VimwikiGoBackLink call vimwiki#base#go_back_link() command! -buffer VimwikiGoBackLink call vimwiki#base#go_back_link()
command! -buffer -nargs=* VimwikiSplitLink call vimwiki#base#follow_link('hsplit', <f-args>) command! -buffer -nargs=* VimwikiSplitLink call vimwiki#base#follow_link('hsplit', <f-args>)
@ -304,6 +310,10 @@ command! -buffer -nargs=* -complete=custom,vimwiki#tags#complete_tags
\ VimwikiSearchTags VimwikiSearch /:<args>:/ \ VimwikiSearchTags VimwikiSearch /:<args>:/
command! -buffer -nargs=* -complete=custom,vimwiki#tags#complete_tags command! -buffer -nargs=* -complete=custom,vimwiki#tags#complete_tags
\ VimwikiGenerateTagLinks call vimwiki#tags#generate_tags(1, <f-args>) \ VimwikiGenerateTagLinks call vimwiki#tags#generate_tags(1, <f-args>)
command! -buffer -nargs=* -complete=custom,vimwiki#tags#complete_tags
\ VimwikiGenerateTags
\ call vimwiki#base#deprecate("VimwikiGenerateTags", "VimwikiGenerateTagLinks") |
\ call vimwiki#tags#generate_tags(1, <f-args>)
command! -buffer VimwikiPasteUrl call vimwiki#html#PasteUrl(expand('%:p')) command! -buffer VimwikiPasteUrl call vimwiki#html#PasteUrl(expand('%:p'))
command! -buffer VimwikiCatUrl call vimwiki#html#CatUrl(expand('%:p')) command! -buffer VimwikiCatUrl call vimwiki#html#CatUrl(expand('%:p'))
@ -357,10 +367,10 @@ nnoremap <silent><script><buffer> <Plug>VimwikiPrevLink
\ :VimwikiPrevLink<CR> \ :VimwikiPrevLink<CR>
nnoremap <silent><script><buffer> <Plug>VimwikiGoto nnoremap <silent><script><buffer> <Plug>VimwikiGoto
\ :VimwikiGoto<CR> \ :VimwikiGoto<CR>
nnoremap <silent><script><buffer> <Plug>VimwikiDeleteLink nnoremap <silent><script><buffer> <Plug>VimwikiDeleteFile
\ :VimwikiDeleteLink<CR> \ :VimwikiDeleteFile<CR>
nnoremap <silent><script><buffer> <Plug>VimwikiRenameLink nnoremap <silent><script><buffer> <Plug>VimwikiRenameFile
\ :VimwikiRenameLink<CR> \ :VimwikiRenameFile<CR>
nnoremap <silent><script><buffer> <Plug>VimwikiDiaryNextDay nnoremap <silent><script><buffer> <Plug>VimwikiDiaryNextDay
\ :VimwikiDiaryNextDay<CR> \ :VimwikiDiaryNextDay<CR>
nnoremap <silent><script><buffer> <Plug>VimwikiDiaryPrevDay nnoremap <silent><script><buffer> <Plug>VimwikiDiaryPrevDay
@ -380,8 +390,8 @@ if str2nr(vimwiki#vars#get_global('key_mappings').links)
call vimwiki#u#map_key('n', '<TAB>', '<Plug>VimwikiNextLink') call vimwiki#u#map_key('n', '<TAB>', '<Plug>VimwikiNextLink')
call vimwiki#u#map_key('n', '<S-TAB>', '<Plug>VimwikiPrevLink') call vimwiki#u#map_key('n', '<S-TAB>', '<Plug>VimwikiPrevLink')
call vimwiki#u#map_key('n', vimwiki#vars#get_global('map_prefix').'n', '<Plug>VimwikiGoto') call vimwiki#u#map_key('n', vimwiki#vars#get_global('map_prefix').'n', '<Plug>VimwikiGoto')
call vimwiki#u#map_key('n', vimwiki#vars#get_global('map_prefix').'d', '<Plug>VimwikiDeleteLink') call vimwiki#u#map_key('n', vimwiki#vars#get_global('map_prefix').'d', '<Plug>VimwikiDeleteFile')
call vimwiki#u#map_key('n', vimwiki#vars#get_global('map_prefix').'r', '<Plug>VimwikiRenameLink') call vimwiki#u#map_key('n', vimwiki#vars#get_global('map_prefix').'r', '<Plug>VimwikiRenameFile')
call vimwiki#u#map_key('n', '<C-Down>', '<Plug>VimwikiDiaryNextDay') call vimwiki#u#map_key('n', '<C-Down>', '<Plug>VimwikiDiaryNextDay')
call vimwiki#u#map_key('n', '<C-Up>', '<Plug>VimwikiDiaryPrevDay') call vimwiki#u#map_key('n', '<C-Up>', '<Plug>VimwikiDiaryPrevDay')
endif endif

View File

@ -93,7 +93,7 @@ Do (RenameLink in_dir11 -> new_dir11):
:Log 'Rename'\<CR> :Log 'Rename'\<CR>
:call WriteMe()\<CR> :call WriteMe()\<CR>
:VimwikiRenameLink\<CR> :VimwikiRenameFile\<CR>
y\<CR> y\<CR>
in_dir11_new\<CR> in_dir11_new\<CR>
:call WriteMe()\<Cr> :call WriteMe()\<Cr>
@ -138,7 +138,7 @@ Do (in_dir2 -> in_dir2_new):
:Log 'Rename'\<CR> :Log 'Rename'\<CR>
:call WriteMe()\<CR> :call WriteMe()\<CR>
:VimwikiRenameLink\<CR> :VimwikiRenameFile\<CR>
y\<CR> y\<CR>
in_dir2_new\<CR> in_dir2_new\<CR>
:call WriteMe()\<Cr> :call WriteMe()\<Cr>