From 5499449cfea44f2a33a0cf8fa039adf96cc6f313 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 22 Nov 2014 13:53:42 -0500 Subject: plugin/auditory.vim: Show warning if mplayer not installed On plugin load, if mplayer isn't installed then fail ungracefully. Since we depend on mplayer in order to play any sounds, my thinking now is that I want to fail immediately. Still trying to decide if this is be best course of action. Maybe I just want an informative message instead of a complete failure. --- plugin/auditory.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugin') diff --git a/plugin/auditory.vim b/plugin/auditory.vim index 87585a3..b657bd9 100644 --- a/plugin/auditory.vim +++ b/plugin/auditory.vim @@ -1,3 +1,10 @@ +" Require mplayer otherwise fail +if !executable('mplayer') + echoerr 'Auditory.vim requires `mplayer` to be installed' + finish +endif + + augroup auditory#insert_mode autocmd! autocmd CursorMovedI * call auditory#PlayScale() -- cgit v1.2.3 From d194dc4e3772f0215c679c83c99fdd2f9c9c6a34 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 22 Nov 2014 14:04:19 -0500 Subject: plugin/auditory.vim: Decrease warning level of mplayer error Instead of echoing and error, just echo a message about mplayer not being installed. Errors look pretty annoying on initial load, and I don't think this is worth the red background colour. It could be that a user has two machines, one with mplayer installed and one without. In that case, I don't want people to have to disable the plugin on one machine. That seems like too much to ask. I think this is a nice middle-ground between alerting users that something is needed by the plugin and not barfing if it's not there. --- plugin/auditory.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugin') diff --git a/plugin/auditory.vim b/plugin/auditory.vim index b657bd9..3ada40e 100644 --- a/plugin/auditory.vim +++ b/plugin/auditory.vim @@ -1,6 +1,6 @@ " Require mplayer otherwise fail if !executable('mplayer') - echoerr 'Auditory.vim requires `mplayer` to be installed' + echomsg 'Auditory.vim requires `mplayer` to be installed' finish endif -- cgit v1.2.3