aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-07-18 20:30:33 -0400
committerTeddy Wing2015-07-18 20:30:33 -0400
commit4bc277b212b75a62b233e494a86f27de49c8ff5b (patch)
tree93d92adcc8366ed2580f372c7d4b3e559bb00143
parent8903b72d2e1b325757d819d43debb825a999b176 (diff)
downloadauditory.vim-4bc277b212b75a62b233e494a86f27de49c8ff5b.tar.bz2
auditory#AssignNormalModeMappings: Use ternary for pipe variable
Assign the pipe variable with a ternary operator to make the function more concise.
-rw-r--r--autoload/auditory.vim7
1 files changed, 3 insertions, 4 deletions
diff --git a/autoload/auditory.vim b/autoload/auditory.vim
index 2662d49..a0a97ec 100644
--- a/autoload/auditory.vim
+++ b/autoload/auditory.vim
@@ -435,10 +435,9 @@ let s:mappings['<c-r>'] = {
function! auditory#AssignNormalModeMappings()
for [key, value] in items(s:mappings)
- let l:pipe = ''
- if match(value, 'exec') !=# -1
- let l:pipe = ' \| '
- endif
+ " If this an `execute` mapping, add a pipe
+ let l:pipe = match(value.map_to, 'exec') !=# -1 ? ' \| ' : ''
+
echom 'nmap <silent> ' . key . ' :<c-u>call auditory#Play("' . value.audio . '")' . l:pipe . value.map_to
endfor
endfunction