Skip to content
Snippets Groups Projects
Commit 82ea0235 authored by Jerome Reybert's avatar Jerome Reybert
Browse files

fix <C-n> issue with mapping_wrapper()

ctrl mapping is not well handled with mapping_wrapper() function,
culprit may be the <C- interpreted somewhere...

Workaround is to directly map the command when no section regex is
provided to mg_set_mapping function.

error message:
E114: Missing quote: "
E116: Invalid arguments for function <SNR>134_mapping_wrapper
parent f1a2291a
No related branches found
No related tags found
No related merge requests found
...@@ -73,14 +73,20 @@ endfunction ...@@ -73,14 +73,20 @@ endfunction
" param[in] function the function to call (rhs) " param[in] function the function to call (rhs)
" param[in] ... : optional, section, the regex of the section(s) " param[in] ... : optional, section, the regex of the section(s)
function! s:mg_set_mapping(mode, mapping, function, ...) function! s:mg_set_mapping(mode, mapping, function, ...)
if ( a:0 == 1 )
execute a:mode . "noremap <buffer><silent><nowait> " execute a:mode . "noremap <buffer><silent><nowait> "
\ . a:mapping . \ . a:mapping .
\ " :call <SID>mapping_wrapper(\"" . \ " :call <SID>mapping_wrapper(\"" .
\ a:mapping . "\", \"" . \ a:mapping . "\", \"" .
\ a:function . "\"" . \ a:function . "\"" .
\ ( ( a:0 == 1 ) ? \ ", \'" . a:1 . "\'" .
\ ", \'" . a:1 . "\'" : '' ) \ ")<cr>"
\ . ")<cr>" else
execute a:mode . "noremap <buffer><silent><nowait> "
\ . a:mapping .
\ " :call " .
\ a:function . "<cr>"
endif
endfunction endfunction
function! magit#mapping#set_default() function! magit#mapping#set_default()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment