From 6ce37e5cfc6708d543fc7976e81032fe2023a59c Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Tue, 27 May 2014 10:58:15 -0600 Subject: [PATCH] Added prompt if alternate file does not exist, asking if you want to create it --- autoload/projectionist.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/projectionist.vim b/autoload/projectionist.vim index a70b391..31201bd 100644 --- a/autoload/projectionist.vim +++ b/autoload/projectionist.vim @@ -480,7 +480,12 @@ function! s:edit_command(cmd, count, ...) abort endif let file = get(filter(copy(alternates), '!empty(getftype(v:val))'), 0, '') if empty(file) - return 'echoerr "No alternate file"' + let choice = confirm("No alternate file. Create?", "&Yes\n&No", 2, "Question") + if choice == 1 + return a:cmd . ' ' . fnameescape(alternates[0]) + else + return 'echoerr "No alternate file"' + endif endif endif if !isdirectory(fnamemodify(file, ':h'))