diff options
| author | Teddy Wing | 2015-07-18 22:15:16 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-07-18 22:25:36 -0400 |
| commit | a3fcb8c8a3b7d05ef354aa250acef49d2c5a8fba (patch) | |
| tree | b77f27358808b1dc5aa0eeb5b073eca39e44733f | |
| parent | 83449bf7e30d45f91eccbcdffd56abb126be56c1 (diff) | |
| download | auditory.vim-a3fcb8c8a3b7d05ef354aa250acef49d2c5a8fba.tar.bz2 | |
autoload/auditory.vim: Always map with <silent>
Turns out my assumption that we didn't need <silent> when `execute`ing
in 83449bf7e30d45f91eccbcdffd56abb126be56c1 was incorrect. When
performing <C-d>, the audio play command appears in the command line,
which is not the behaviour we want.
Let's just revert to always using `<silent>` 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.
| -rw-r--r-- | autoload/auditory.vim | 12 |
1 files 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['<c-r>'] = { 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 = '<silent>' - endif - - execute 'nmap ' . l:silence . ' ' . key . + execute 'nmap <silent>' . key . \ ' :<c-u>call auditory#Play("' . value.audio . '")' . \ l:pipe . value.map_to endfor |
