From a8301256a74733ef48e882454e503769db15690a Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 17 Sep 2015 14:47:47 +0200 Subject: [PATCH] Now uses tab char and size from config.json when creating new C++ project. Also fixed a minor issue when using tab as tab_char. --- src/source.cc | 10 ++++++---- src/window.cc | 7 ++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/source.cc b/src/source.cc index 8c62866..a11a531 100644 --- a/src/source.cc +++ b/src/source.cc @@ -1472,10 +1472,12 @@ bool Source::ClangViewParse::on_key_press_event(GdkEventKey* key) { iter=get_buffer()->get_insert()->get_iter(); auto found_iter=iter; if(find_open_expression_symbol(iter, start_of_sentence_iter, found_iter)) { - auto offset=found_iter.get_line_offset(); - tabs.clear(); - for(int c=0;cinsert_at_cursor("\n"+tabs+tab); diff --git a/src/window.cc b/src/window.cc index 343fda6..3743727 100644 --- a/src/window.cc +++ b/src/window.cc @@ -513,8 +513,13 @@ void Window::new_cpp_project_dialog() { Singleton::terminal()->print("Error: "+cpp_main_path.string()+" already exists.\n"); return; } + auto tab_char=Singleton::Config::source()->default_tab_char; + auto tab_size=Singleton::Config::source()->default_tab_size; + std::string tab; + for(unsigned c=0;c