Update build#dir() to open a popup_menu()

Use `popup_menu()` in `build#dir()` when the `:BuildDir` command is uses
without an argument to specify a build directory. If there are no build
directories, print an error message. If there is a single build
directory, use it. If there are multiple build directories use
`popup_menu()` to prompt the user to select the desired build directory.

Update `build#targets()` and `build#run()` with comments and error
messages.
This commit is contained in:
2021-01-06 00:23:32 +00:00
parent c94bc3ba90
commit aaa8acf5a2
2 changed files with 56 additions and 8 deletions

View File

@@ -31,5 +31,5 @@ command! -nargs=+ -complete=file Debug call do#debug(<f-args>)
command! TodoFile lvimgrep /todo/ %
" Change build directory
command! -nargs=1 -complete=dir BuildDir call build#dir(<f-args>)
command! -nargs=? -complete=dir BuildDir call build#dir(<f-args>)
command! -nargs=* -complete=custom,build#targets Build call build#run(<f-args>)