diff --git a/src/source_clang.cc b/src/source_clang.cc index 3bf267d..3aa2ab1 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -127,11 +127,9 @@ void Source::ClangViewParse::init_parse() { parse_start(); } else if (parse_thread_mapped && parsing_mutex.try_lock() && parse_thread_buffer_map_mutex.try_lock()) { - int status=0; if(!clang_tu) clang_tu = std::unique_ptr(new clang::TranslationUnit(clang_index, file_path.string(), get_compilation_commands(), parse_thread_buffer_map)); - else - status=clang_tu->ReparseTranslationUnit(parse_thread_buffer_map); + int status=clang_tu->ReparseTranslationUnit(parse_thread_buffer_map); if(status==0) clang_tokens=clang_tu->get_tokens(0, parse_thread_buffer_map.find(file_path.string())->second.size()-1); else @@ -159,20 +157,13 @@ std::map Source::ClangViewParse::get_buffer_map() cons void Source::ClangViewParse::start_reparse() { parse_thread_mapped=false; source_readable=false; - int delay; - if(!is_reparsed) { - delay=0; - is_reparsed=true; - } - else - delay=1000; delayed_reparse_connection.disconnect(); delayed_reparse_connection=Glib::signal_timeout().connect([this]() { source_readable=false; parse_thread_go=true; set_status("parsing..."); return false; - }, delay); + }, 1000); } std::vector Source::ClangViewParse::get_compilation_commands() { diff --git a/src/source_clang.h b/src/source_clang.h index 36470f0..20c8214 100644 --- a/src/source_clang.h +++ b/src/source_clang.h @@ -61,7 +61,6 @@ namespace Source { static clang::Index clang_index; std::vector get_compilation_commands(); - bool is_reparsed=false; Glib::Dispatcher parse_done; Glib::Dispatcher parse_start; Glib::Dispatcher parse_fail;