Unify all messages to the user
This commit is contained in:
parent
4956976bb6
commit
68cdfe36df
@ -390,7 +390,7 @@ function! vimwiki#base#system_open_link(url) "{{{
|
||||
return
|
||||
endif
|
||||
endtry
|
||||
echomsg 'Default Vimwiki link handler was unable to open the HTML file!'
|
||||
echomsg 'Vimwiki Error: Default Vimwiki link handler was unable to open the HTML file!'
|
||||
endfunction "}}}
|
||||
|
||||
" vimwiki#base#open_link
|
||||
@ -398,7 +398,7 @@ function! vimwiki#base#open_link(cmd, link, ...) "{{{
|
||||
let link_infos = vimwiki#base#resolve_link(a:link)
|
||||
|
||||
if link_infos.filename == ''
|
||||
echom 'Vimwiki Error: Unable to resolve link!'
|
||||
echomsg 'Vimwiki Error: Unable to resolve link!'
|
||||
return
|
||||
endif
|
||||
|
||||
@ -505,7 +505,7 @@ function! vimwiki#base#backlinks() "{{{
|
||||
endfor
|
||||
|
||||
if empty(locations)
|
||||
echom 'vimwiki: no other file links to this file'
|
||||
echomsg 'Vimwiki: No other file links to this file'
|
||||
else
|
||||
call setloclist(0, locations, 'r')
|
||||
lopen
|
||||
@ -823,7 +823,7 @@ function! vimwiki#base#check_links() "{{{
|
||||
endfor
|
||||
|
||||
if empty(errors)
|
||||
echom 'Vimwiki: all links are OK'
|
||||
echomsg 'Vimwiki: All links are OK'
|
||||
else
|
||||
call setqflist(errors, 'r')
|
||||
copen
|
||||
@ -846,8 +846,8 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...) "{{{
|
||||
let ok = vimwiki#path#mkdir(dir, 1)
|
||||
|
||||
if !ok
|
||||
echom ' '
|
||||
echom 'Vimwiki: Unable to edit file in non-existent directory: '.dir
|
||||
echomsg ' '
|
||||
echomsg 'Vimwiki Error: Unable to edit file in non-existent directory: '.dir
|
||||
return
|
||||
endif
|
||||
|
||||
@ -880,7 +880,7 @@ endfunction " }}}
|
||||
function! vimwiki#base#search_word(wikiRx, cmd) "{{{
|
||||
let match_line = search(a:wikiRx, 's'.a:cmd)
|
||||
if match_line == 0
|
||||
echomsg 'vimwiki: Wiki link not found.'
|
||||
echomsg 'Vimwiki: Wiki link not found'
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
@ -1281,7 +1281,7 @@ endfunction " }}}
|
||||
" vimwiki#base#goto_index
|
||||
function! vimwiki#base#goto_index(wnum, ...) "{{{
|
||||
if a:wnum > len(g:vimwiki_list)
|
||||
echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!"
|
||||
echomsg 'Vimwiki Error: Wiki '.a:wnum.' is not registered in g:vimwiki_list!'
|
||||
return
|
||||
endif
|
||||
|
||||
@ -1319,7 +1319,7 @@ function! vimwiki#base#delete_link() "{{{
|
||||
try
|
||||
call delete(fname)
|
||||
catch /.*/
|
||||
echomsg 'vimwiki: Cannot delete "'.expand('%:t:r').'"!'
|
||||
echomsg 'Vimwiki Error: Cannot delete "'.expand('%:t:r').'"!'
|
||||
return
|
||||
endtry
|
||||
|
||||
@ -1340,7 +1340,7 @@ function! vimwiki#base#rename_link() "{{{
|
||||
|
||||
" there is no file (new one maybe)
|
||||
if glob(expand('%:p')) == ''
|
||||
echomsg 'vimwiki: Cannot rename "'.expand('%:p').
|
||||
echomsg 'Vimwiki Error: Cannot rename "'.expand('%:p').
|
||||
\'". It does not exist! (New file? Save it before renaming.)'
|
||||
return
|
||||
endif
|
||||
@ -1354,13 +1354,13 @@ function! vimwiki#base#rename_link() "{{{
|
||||
|
||||
if new_link =~# '[/\\]'
|
||||
" It is actually doable but I do not have free time to do it.
|
||||
echomsg 'vimwiki: Cannot rename to a filename with path!'
|
||||
echomsg 'Vimwiki Error: Cannot rename to a filename with path!'
|
||||
return
|
||||
endif
|
||||
|
||||
" check new_fname - it should be 'good', not empty
|
||||
if substitute(new_link, '\s', '', 'g') == ''
|
||||
echomsg 'vimwiki: Cannot rename to an empty filename!'
|
||||
echomsg 'Vimwiki Error: Cannot rename to an empty filename!'
|
||||
return
|
||||
endif
|
||||
|
||||
@ -1375,19 +1375,19 @@ function! vimwiki#base#rename_link() "{{{
|
||||
" do not rename if file with such name exists
|
||||
let fname = glob(new_fname)
|
||||
if fname != ''
|
||||
echomsg 'vimwiki: Cannot rename to "'.new_fname.
|
||||
echomsg 'Vimwiki Error: Cannot rename to "'.new_fname.
|
||||
\ '". File with that name exist!'
|
||||
return
|
||||
endif
|
||||
" rename wiki link file
|
||||
try
|
||||
echomsg "Renaming ".VimwikiGet('path').old_fname." to ".new_fname
|
||||
echomsg 'Vimwiki: Renaming '.VimwikiGet('path').old_fname.' to '.new_fname
|
||||
let res = rename(expand('%:p'), expand(new_fname))
|
||||
if res != 0
|
||||
throw "Cannot rename!"
|
||||
end
|
||||
catch /.*/
|
||||
echomsg 'vimwiki: Cannot rename "'.expand('%:t:r').'" to "'.new_fname.'"'
|
||||
echomsg 'Vimwiki Error: Cannot rename "'.expand('%:t:r').'" to "'.new_fname.'"'
|
||||
return
|
||||
endtry
|
||||
|
||||
@ -1428,7 +1428,7 @@ function! vimwiki#base#rename_link() "{{{
|
||||
\ cur_buffer[1]])
|
||||
" execute 'bwipeout '.escape(cur_buffer[0], ' ')
|
||||
|
||||
echomsg old_fname." is renamed to ".new_fname
|
||||
echomsg 'Vimwiki: '.old_fname.' is renamed to '.new_fname
|
||||
|
||||
let &more = setting_more
|
||||
endfunction " }}}
|
||||
|
@ -161,7 +161,7 @@ endfunction "}}}
|
||||
|
||||
function! vimwiki#diary#make_note(wnum, ...) "{{{
|
||||
if a:wnum > len(g:vimwiki_list)
|
||||
echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!"
|
||||
echomsg 'Vimwiki Error: Wiki '.a:wnum.' is not registered in g:vimwiki_list!'
|
||||
return
|
||||
endif
|
||||
|
||||
@ -191,7 +191,7 @@ endfunction "}}}
|
||||
|
||||
function! vimwiki#diary#goto_diary_index(wnum) "{{{
|
||||
if a:wnum > len(g:vimwiki_list)
|
||||
echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!"
|
||||
echomsg 'Vimwiki Error: Wiki '.a:wnum.' is not registered in g:vimwiki_list!'
|
||||
return
|
||||
endif
|
||||
|
||||
@ -254,7 +254,7 @@ function! vimwiki#diary#generate_diary_section() "{{{
|
||||
call vimwiki#base#update_listing_in_buffer(s:format_diary(),
|
||||
\ VimwikiGet('diary_header'), content_rx, line('$')+1, 1)
|
||||
else
|
||||
echom "vimwiki: You can generate diary links only in a diary index page!"
|
||||
echomsg 'Vimwiki Error: You can generate diary links only in a diary index page!'
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
|
@ -80,7 +80,7 @@ function! s:create_default_CSS(path) " {{{
|
||||
if default_css != ''
|
||||
let lines = readfile(default_css)
|
||||
call writefile(lines, css_full_name)
|
||||
echomsg "Default style.css has been created."
|
||||
echomsg 'Vimwiki: Default style.css has been created'
|
||||
endif
|
||||
endif
|
||||
endfunction "}}}
|
||||
@ -112,7 +112,7 @@ function! s:get_html_template(template) "{{{
|
||||
let lines = readfile(template_name)
|
||||
return lines
|
||||
catch /E484/
|
||||
echomsg 'vimwiki: html template '.template_name.
|
||||
echomsg 'Vimwiki: HTML template '.template_name.
|
||||
\ ' does not exist!'
|
||||
endtry
|
||||
endif
|
||||
@ -171,7 +171,7 @@ function! s:delete_html_files(path) "{{{
|
||||
try
|
||||
call delete(fname)
|
||||
catch
|
||||
echomsg 'vimwiki: Cannot delete '.fname
|
||||
echomsg 'Vimwiki Error: Cannot delete '.fname
|
||||
endtry
|
||||
endfor
|
||||
endfunction "}}}
|
||||
@ -1501,7 +1501,7 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{
|
||||
endif
|
||||
|
||||
if done == 0
|
||||
echomsg 'vimwiki: conversion to HTML is not supported for this syntax!!!'
|
||||
echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax'
|
||||
return
|
||||
endif
|
||||
|
||||
@ -1511,11 +1511,11 @@ endfunction "}}}
|
||||
|
||||
function! vimwiki#html#WikiAll2HTML(path_html) "{{{
|
||||
if !s:syntax_supported() && !s:use_custom_wiki2html()
|
||||
echomsg 'vimwiki: conversion to HTML is not supported for this syntax!!!'
|
||||
echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax'
|
||||
return
|
||||
endif
|
||||
|
||||
echomsg 'Saving vimwiki files...'
|
||||
echomsg 'Vimwiki: Saving Vimwiki files ...'
|
||||
let save_eventignore = &eventignore
|
||||
let &eventignore = "all"
|
||||
let cur_buf = bufname('%')
|
||||
@ -1526,10 +1526,10 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{
|
||||
let path_html = expand(a:path_html)
|
||||
call vimwiki#path#mkdir(path_html)
|
||||
|
||||
echomsg 'Deleting non-wiki html files...'
|
||||
echomsg 'Vimwiki: Deleting non-wiki html files ...'
|
||||
call s:delete_html_files(path_html)
|
||||
|
||||
echomsg 'Converting wiki to html files...'
|
||||
echomsg 'Vimwiki: Converting wiki to html files ...'
|
||||
let setting_more = &more
|
||||
setlocal nomore
|
||||
|
||||
@ -1547,11 +1547,11 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{
|
||||
call VimwikiSet('invsubdir', vimwiki#base#invsubdir(subdir))
|
||||
|
||||
if !s:is_html_uptodate(wikifile)
|
||||
echomsg 'Processing '.wikifile
|
||||
echomsg 'Vimwiki: Processing '.wikifile
|
||||
|
||||
call vimwiki#html#Wiki2HTML(path_html, wikifile)
|
||||
else
|
||||
echomsg 'Skipping '.wikifile
|
||||
echomsg 'Vimwiki: Skipping '.wikifile
|
||||
endif
|
||||
endfor
|
||||
" reset 'subdir' state variable
|
||||
@ -1559,8 +1559,8 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{
|
||||
call VimwikiSet('invsubdir', current_invsubdir)
|
||||
|
||||
call s:create_default_CSS(path_html)
|
||||
echomsg 'HTML exported to '.path_html
|
||||
echomsg 'Done!'
|
||||
echomsg 'Vimwiki: HTML exported to '.path_html
|
||||
echomsg 'Vimwiki: Done!'
|
||||
|
||||
let &more = setting_more
|
||||
endfunction "}}}
|
||||
|
@ -2356,7 +2356,7 @@ A second example handles a new scheme, "vfile:", which behaves similar to
|
||||
endif
|
||||
let link_infos = vimwiki#base#resolve_link(link)
|
||||
if link_infos.filename == ''
|
||||
echom 'Vimwiki Error: Unable to resolve link!'
|
||||
echomsg 'Vimwiki Error: Unable to resolve link!'
|
||||
return 0
|
||||
else
|
||||
exe 'tabnew ' . fnameescape(link_infos.filename)
|
||||
|
Loading…
Reference in New Issue
Block a user