From 0adb3c1b578fb0118de6387bddeea633bb1e1a94 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 18 Jul 2015 22:34:44 -0400 Subject: autoload/auditory.vim: Ensure we `` if we're not piping If we're not piping to an `execute` command in the mapping, we need to `` to execute the sound player and type the normal mode command. Otherwise the normal mode command gets typed in command mode which is not what we want and messes things up greatly. Figured I would just tack the `` on to the pipe variable rather than create a new one since it's the inverse of what we need in that situation. Hopefully the intention is clear enough but I'll grant that this doesn't expose the most clarity. Edit: Added a comment for better explanation of the . --- autoload/auditory.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/auditory.vim b/autoload/auditory.vim index a981e0a..4980ba5 100644 --- a/autoload/auditory.vim +++ b/autoload/auditory.vim @@ -435,8 +435,9 @@ let s:mappings[''] = { function! auditory#AssignNormalModeMappings() for [key, value] in items(s:mappings) - " If this an `execute` mapping, add a pipe - let l:pipe = match(value.map_to, 'exec') !=# -1 ? ' \| ' : '' + " If this an `execute` mapping, add a pipe. + " Otherwise to exit command mode. + let l:pipe = match(value.map_to, 'exec') !=# -1 ? ' \| ' : '' execute 'nnoremap ' . key . \ ' :call auditory#Play("' . value.audio . '")' . -- cgit v1.2.3