vimwiki

Personal wiki for vim
git clone https://github.com/vimwiki/vimwiki.git
Log | Files | Refs | README | LICENSE

commit 827b3a89745eaddf84035a5f3010c33aafc574a3
parent 13bdb43a5477f08728bc086e12b468dc8b28f485
Author: EinfachToll <istjanichtzufassen@googlemail.com>
Date:   Sat,  7 Feb 2015 22:01:20 +0100

Unify yes/no question

Diffstat:
Mautoload/vimwiki/base.vim | 14+++++++-------
Mautoload/vimwiki/path.vim | 3++-
2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim @@ -71,7 +71,7 @@ function! vimwiki#base#read_wiki_options(check) " {{{ Attempt to read wiki " echo "\nFound file : ".local_wiki_options_filename let query = "Vimwiki: Check for options in this file [Y]es/[n]o? " - if a:check > 0 && (tolower(input(query)) !~ "y") + if a:check > 0 && input(query) =~? '^n') continue endif " @@ -86,7 +86,7 @@ function! vimwiki#base#read_wiki_options(check) " {{{ Attempt to read wiki if a:check > 0 echo "\n\nFound wiki options\n g:local_wiki = ".string(g:local_wiki) let query = "Vimwiki: Apply these options [Y]es/[n]o? " - if tolower(input(query)) !~ "y" + if input(query) =~? '^n' let g:local_wiki = {} continue endif @@ -1210,8 +1210,8 @@ endfunction "}}} function! vimwiki#base#delete_link() "{{{ "" file system funcs "" Delete wiki link you are in from filesystem - let val = input('Delete ['.expand('%').'] (y/n)? ', "") - if val != 'y' + let val = input('Delete "'.expand('%').'" [y]es/[N]o? ') + if val !~? '^y' return endif let fname = expand('%:p') @@ -1244,12 +1244,12 @@ function! vimwiki#base#rename_link() "{{{ return endif - let val = input('Rename "'.expand('%:t:r').'" (y/n)? ', "") - if val!='y' + let val = input('Rename "'.expand('%:t:r').'" [y]es/[N]o? ') + if val !~? '^y' return endif - let new_link = input('Enter new name: ', "") + let new_link = input('Enter new name: ') if new_link =~ '[/\\]' " It is actually doable but I do not have free time to do it. diff --git a/autoload/vimwiki/path.vim b/autoload/vimwiki/path.vim @@ -116,7 +116,8 @@ function! vimwiki#path#mkdir(path, ...) "{{{ let path = iconv(path, &enc, g:vimwiki_w32_dir_enc) endif - if a:0 && a:1 && tolower(input("Vimwiki: Make new directory: ".path."\n [Y]es/[n]o? ")) !~ "^y" + if a:0 && a:1 && input("Vimwiki: Make new directory: " + \ .path."\n [y]es/[N]o? ") !~? '^y' return 0 endif