Store project style settings in VCS.

I'm sick of getting my settings stomped on every god damn time I open CLion.
This commit is contained in:
Kyle Isom 2023-10-11 19:25:24 -07:00
parent 187ff6cb01
commit fd6e0c6899
12 changed files with 148 additions and 71 deletions

2
.gitignore vendored
View File

@ -1,7 +1,7 @@
.cmake
.idea
.trunk
.vc
.vs
.vscode
*.a

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,29 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C>
<option name="FUNCTION_BRACE_PLACEMENT" value="2" />
</Objective-C>
<files>
<extensions>
<pair source="cc" header="h" fileNamingConvention="PASCAL_CASE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
<pair source="cu" header="cuh" fileNamingConvention="NONE" />
<pair source="ixx" header="" fileNamingConvention="NONE" />
<pair source="mxx" header="" fileNamingConvention="NONE" />
<pair source="cppm" header="" fileNamingConvention="NONE" />
<pair source="ccm" header="" fileNamingConvention="NONE" />
<pair source="cxxm" header="" fileNamingConvention="NONE" />
<pair source="c++m" header="" fileNamingConvention="NONE" />
</extensions>
</files>
<codeStyleSettings language="ObjectiveC">
<option name="ALIGN_GROUP_FIELD_DECLARATIONS" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="8" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
<option name="USE_TAB_CHARACTER" value="true" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

2
.idea/kge.iml Normal file
View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

9
.idea/misc.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
<component name="CidrRootsConfiguration">
<libraryRoots>
<file path="$PROJECT_DIR$/ext" />
</libraryRoots>
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/kge.iml" filepath="$PROJECT_DIR$/.idea/kge.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -44,20 +44,20 @@ anonymousName()
Buffer::Buffer()
: name(anonymousName()), path(std::nullopt), file(std::nullopt)
: name(anonymousName())
{
}
Buffer::Buffer(std::string fName)
: name(std::move(fName)), path(std::nullopt), file(std::nullopt)
: name(std::move(fName))
{
}
Buffer::Buffer(std::string fName, std::string fPath)
: name(std::move(fName)), path(std::move(fPath)), file(std::nullopt)
: name(std::move(fName)), path(std::move(fPath))
{
if (this->path) {
this->file = OptFile(File(this->path.value()));

View File

@ -9,10 +9,12 @@
#define KEPP_FRAME_H
#include <cstdint>
#include <vector>
#include "Defs.h"
#include "File.h"
#include "Cursor.h"
typedef std::vector<std::vector<uint8_t>> BufferContents;
@ -50,6 +52,7 @@ private:
std::string name;
OptString path;
OptFile file;
Cursor cursor;
BufferContents contents;
};

View File

@ -21,6 +21,8 @@ set(BUILD_GUI OFF CACHE BOOL "Disable building the graphical version.")
if (CMAKE_HOST_UNIX)
message(STATUS "Build system is POSIX.")
else ()
message(STATUS "Build system is NOT POSIX.")
endif ()
if (MSVC)
@ -67,11 +69,13 @@ set(SOURCE_FILES
add_executable(ke main.cc ${SOURCE_FILES} ${HEADER_FILES})
if (CMAKE_HOST_UNIX)
add_custom_target(manpages)
configure_file(docs/ke.md ke.1.scdoc @ONLY)
add_custom_command(TARGET manpages COMMAND scdoc < ke.1.scdoc > ke.1
OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/ke.1)
add_dependencies(ke manpages)
endif ()
if (${BUILD_GUI})
configure_file(resources/kge.desktop.in kge.desktop @ONLY)
@ -79,12 +83,14 @@ if(${BUILD_GUI})
target_link_libraries(kge imgui)
add_dependencies(kge ke)
if (CMAKE_HOST_UNIX)
configure_file(docs/kge.md kge.1.scdoc @ONLY)
add_custom_command(TARGET manpages COMMAND scdoc < kge.1.scdoc > kge.1
OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/kge.1)
add_dependencies(kge manpages)
endif ()
endif ()
#######################
### INSTALL TARGETS ###

View File

@ -32,7 +32,8 @@
/// Cursors represent a position in a Buffer.
class Cursor {
public:
Cursor(size_t _x, size_t _y) : x(_x), y(_y) {};
Cursor() : x(0), y(0) {}
Cursor(size_t _x, size_t _y) : x(_x), y(_y) {}
size_t X() const { return this->x; }
size_t Y() const { return this->y; }