From f538e22f13e264d5eaf89e9473808d4f4a595780 Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 20 Feb 2017 16:42:55 +0100 Subject: [PATCH] Fixed regex for identifying include directives --- src/source_clang.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/source_clang.cc b/src/source_clang.cc index 2ca0cb7..e9d8fb4 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -1014,7 +1014,7 @@ Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file auto get_header_location=[this]() { // If cursor is at an include line, return offset to included file - const static std::regex include_regex("^[ \t]*#[ \t]*include[ \t]*[<\"](.+)[>\"][ \t]*$"); + const static std::regex include_regex("^[ \t]*#[ \t]*include[ \t]*[<\"]([^<>\"]+)[>\"].*$"); std::smatch sm; auto line=get_line(); if(std::regex_match(line, sm, include_regex)) {