From 4bc277b212b75a62b233e494a86f27de49c8ff5b Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 18 Jul 2015 20:30:33 -0400 Subject: auditory#AssignNormalModeMappings: Use ternary for pipe variable Assign the pipe variable with a ternary operator to make the function more concise. --- autoload/auditory.vim | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'autoload') 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[''] = { 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 ' . key . ' :call auditory#Play("' . value.audio . '")' . l:pipe . value.map_to endfor endfunction -- cgit v1.2.3