Skip to content

Commit

Permalink
Improve :CleanViewdir prompt and add output
Browse files Browse the repository at this point in the history
This style of format is more consistent with most unix-y tools, and at
least to me, more intuitive.

Also, having it output something after the user provides their input
stops me from wanting to run :CleanViewdir again to verify that it
worked.
  • Loading branch information
zhimsel committed Jul 7, 2023
1 parent bae5f7f commit af61418
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autoload/stay/viewdir.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ function! stay#viewdir#clean(bang, ...) abort
let l:candcount = len(l:candidates)
let l:delcount = 0
if a:bang is 1 ||
\ input("Type 'y' to delete ".l:candcount." view session files: ") is? 'y'
\ input("Delete ".l:candcount." view session files? (y/n): ") is? 'y'
for l:file in l:candidates
let l:delcount += (delete(l:file) is 0)
endfor
endif
echo "\nDeleted ".l:delcount." files."
return [l:candcount, l:delcount]
endfunction

Expand Down

0 comments on commit af61418

Please sign in to comment.