Browse Source

Removed SpaceBeforeParens: Never as default since it is very common to have spaces for instance between if and (

merge-requests/389/head
eidheim 7 years ago
parent
commit
d4fcd709df
  1. 2
      src/files.h
  2. 4
      src/window.cc

2
src/files.h

@ -61,7 +61,7 @@ const std::string default_config_file = R"RAW({
"enable_multiple_cursors": false,
"auto_reload_changed_files": true,
"clang_format_style_comment": "IndentWidth, AccessModifierOffset and UseTab are set automatically. See http://clang.llvm.org/docs/ClangFormatStyleOptions.html",
"clang_format_style": "ColumnLimit: 0, MaxEmptyLinesToKeep: 2, SpaceBeforeParens: Never, NamespaceIndentation: All, BreakBeforeBraces: Custom, BraceWrapping: {BeforeElse: true, BeforeCatch: true}",
"clang_format_style": "ColumnLimit: 0, MaxEmptyLinesToKeep: 2, NamespaceIndentation: All, BreakBeforeBraces: Custom, BraceWrapping: {BeforeElse: true, BeforeCatch: true}",
"clang_usages_threads_comment": "The number of threads used in finding usages in unparsed files. -1 corresponds to the number of cores available, and 0 disables the search",
"clang_usages_threads": -1
},

4
src/window.cc

@ -256,7 +256,7 @@ void Window::set_menu_actions() {
}
std::string cmakelists = "cmake_minimum_required(VERSION 2.8)\n\nproject(" + project_name + ")\n\nset(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} -std=c11 -Wall -Wextra\")\n\nadd_executable(" + project_name + " main.c)\n";
std::string c_main = "#include <stdio.h>\n\nint main() {\n printf(\"Hello World!\\n\");\n}\n";
std::string clang_format = "IndentWidth: 2\nAccessModifierOffset: -2\nUseTab: Never\nColumnLimit: 0\nMaxEmptyLinesToKeep: 2\nSpaceBeforeParens: Never\nBreakBeforeBraces: Custom\nBraceWrapping: {BeforeElse: true, BeforeCatch: true}\n";
std::string clang_format = "IndentWidth: 2\nAccessModifierOffset: -2\nUseTab: Never\nColumnLimit: 0\nMaxEmptyLinesToKeep: 2\nBreakBeforeBraces: Custom\nBraceWrapping: {BeforeElse: true, BeforeCatch: true}\n";
if(filesystem::write(cmakelists_path, cmakelists) && filesystem::write(c_main_path, c_main) && filesystem::write(clang_format_path, clang_format)) {
Directories::get().open(project_path);
Notebook::get().open(c_main_path);
@ -292,7 +292,7 @@ void Window::set_menu_actions() {
}
std::string cmakelists = "cmake_minimum_required(VERSION 2.8)\n\nproject(" + project_name + ")\n\nset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++1y -Wall -Wextra\")\n\nadd_executable(" + project_name + " main.cpp)\n";
std::string cpp_main = "#include <iostream>\n\nint main() {\n std::cout << \"Hello World!\\n\";\n}\n";
std::string clang_format = "IndentWidth: 2\nAccessModifierOffset: -2\nUseTab: Never\nColumnLimit: 0\nMaxEmptyLinesToKeep: 2\nSpaceBeforeParens: Never\nBreakBeforeBraces: Custom\nBraceWrapping: {BeforeElse: true, BeforeCatch: true}\nNamespaceIndentation: All\n";
std::string clang_format = "IndentWidth: 2\nAccessModifierOffset: -2\nUseTab: Never\nColumnLimit: 0\nMaxEmptyLinesToKeep: 2\nBreakBeforeBraces: Custom\nBraceWrapping: {BeforeElse: true, BeforeCatch: true}\nNamespaceIndentation: All\n";
if(filesystem::write(cmakelists_path, cmakelists) && filesystem::write(cpp_main_path, cpp_main) && filesystem::write(clang_format_path, clang_format)) {
Directories::get().open(project_path);
Notebook::get().open(cpp_main_path);

Loading…
Cancel
Save