I have a function that calls confirm to get user input, performs an action, then prints a message to the user:
function! PerformAction()
let answer = confirm('Do thing?', "&Yes\n&No", 1)
if answer == 1
call system("do_thing")
echo "Did thing!"
endif
endfunction
The issue I'm having is that this ends up forcing the user to hit [Enter] an extra time after executing the command, because the command line has expanded to display the prompt and the message.
Is it possible to prevent this, so that after the user enters a value for the prompt, the command line is cleared, the call system is executed, then the single line displaying "Did thing!" is printed in the command line, allowing the user to immediately continue working?