From d56eb33385945b1ea757c23486700985239412c5 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 12 Apr 2019 19:25:35 +0200 Subject: [PATCH] Fixes #include-completion where an extra " or > was added after inserted text --- src/source_clang.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/source_clang.cc b/src/source_clang.cc index 3ddf709..5107a52 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -762,6 +762,10 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa } } } + // Do not insert last " or > inside #include statements + if(!row.empty() && ((row.back() == '"' && row.find('"') == row.size() - 1) || (row.back() == '>' && row.find('<') == std::string::npos))) + row.pop_back(); + get_buffer()->insert(CompletionDialog::get()->start_mark->get_iter(), row); //if selection is finalized, select text inside template arguments or function parameters if(hide_window) {