From a3fcb8c8a3b7d05ef354aa250acef49d2c5a8fba Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 18 Jul 2015 22:15:16 -0400 Subject: autoload/auditory.vim: Always map with Turns out my assumption that we didn't need when `execute`ing in 83449bf7e30d45f91eccbcdffd56abb126be56c1 was incorrect. When performing , the audio play command appears in the command line, which is not the behaviour we want. Let's just revert to always using `` and figure that should work for us. Figured out between the last commit and this one that my manual testing wasn't with the latest code. I was using a037e921a4b9b0539c93450fe3df1f6c8175ceab this whole time because I didn't have my development setup configured correctly. Now I can actually see what's going on as I make changes (what a concept!). Also bring back the ternary since we're not setting any more variables for this condition any more. --- autoload/auditory.vim | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/autoload/auditory.vim b/autoload/auditory.vim index 22a7cd1..596fefe 100644 --- a/autoload/auditory.vim +++ b/autoload/auditory.vim @@ -435,16 +435,10 @@ let s:mappings[''] = { function! auditory#AssignNormalModeMappings() for [key, value] in items(s:mappings) - let l:pipe = '' - let l:silence = '' + " If this an `execute` mapping, add a pipe + let l:pipe = match(value.map_to, 'exec') !=# -1 ? ' \| ' : '' - " If this an `execute` mapping - if match(value.map_to, 'exec') !=# -1 - let l:pipe = ' \| ' - let l:silence = '' - endif - - execute 'nmap ' . l:silence . ' ' . key . + execute 'nmap ' . key . \ ' :call auditory#Play("' . value.audio . '")' . \ l:pipe . value.map_to endfor -- cgit v1.2.3