Skip to content

Commit

Permalink
Merge pull request #427 from mkc188/master
Browse files Browse the repository at this point in the history
Fix return key mapping conflicts with auto-pairs
  • Loading branch information
tobiasgrosser committed Nov 19, 2014
2 parents 6a7ad82 + 2f2fdd7 commit 70c9796
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/clang_complete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ function! ClangComplete(findstart, base)
python timer.registerEvent("Load into vimscript")

if g:clang_make_default_keymappings == 1
let s:old_cr = maparg('<CR>', 'i')
inoremap <expr> <buffer> <C-Y> <SID>HandlePossibleSelectionCtrlY()
inoremap <expr> <buffer> <CR> <SID>HandlePossibleSelectionEnter()
endif
Expand Down Expand Up @@ -475,14 +476,14 @@ function! s:HandlePossibleSelectionCtrlY()
endfunction

function! s:TriggerSnippet()
execute 'inoremap <script> <buffer> <silent> <CR> '.s:old_cr
" Dont bother doing anything until we're sure the user exited the menu
if !b:snippet_chosen
return
endif

" Stop monitoring as we'll trigger a snippet
silent! iunmap <buffer> <C-Y>
silent! iunmap <buffer> <CR>
augroup ClangComplete
au! CursorMovedI <buffer>
augroup end
Expand Down

0 comments on commit 70c9796

Please sign in to comment.