Skip to content

My CTRL-Y mapping is broken by clang_complete #358

Open
@bmerry

Description

@bmerry

It doesn't happen all the time - it seems to depend on how one interacts with the completion window. Steps to reproduce on Ubuntu 13.10 with gvim 7.4:

Put the following in .vimrc (and obviously do :BundleInstall if needed to install clang_complete):

set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'Rip-Rip/clang_complete'
filetype plugin indent on
syntax enable
inoremap <C-Y> <C-O>dd
let g:clang_library_path = '/usr/lib/llvm-3.4/lib'
let g:clang_complete_auto = 0

Open a .cpp and insert the following text:

#include <iostream>
int main() {
        std::cout.fl

Press <C-X><C-U> to trigger completion. Do not do anything to select a match; simply keep typing some letters, then press Enter. Now press <C-Y>: it will start copying characters from the previous line (the default i_CTRL-Y mapping) instead of deleting the current line (as specified by the .vimrc). Running inoremap <C-Y> reports the following mappings:

i  <C-Y>       *@<SNR>19_HandlePossibleSelectionCtrlY()
i  <C-Y>       * <C-O>dd

On the other hand, if after pressing <C-X><C-U> one presses <C-U> again to select the first match, then enter to dismiss the popup, the expected behaviour is restored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions