From 2142ef2ce90fbaa41a036663f57f667bb524cde2 Mon Sep 17 00:00:00 2001 From: Peter Slattery Date: Sat, 27 Apr 2024 13:43:54 -0700 Subject: [PATCH] Cleaning up line endings on save --- code/custom/4coder_default_hooks.cpp | 2 ++ code/ship_files/config.4coder | 2 +- project.4coder | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/custom/4coder_default_hooks.cpp b/code/custom/4coder_default_hooks.cpp index 484467c4..17c61100 100644 --- a/code/custom/4coder_default_hooks.cpp +++ b/code/custom/4coder_default_hooks.cpp @@ -919,6 +919,8 @@ BUFFER_HOOK_SIG(default_file_save){ Managed_Scope scope = buffer_get_managed_scope(app, buffer_id); Line_Ending_Kind *eol = scope_attachment(app, scope, buffer_eol_setting, Line_Ending_Kind); + + clean_all_lines_buffer(app, buffer_id, CleanAllLinesMode_RemoveBlankLines); switch (*eol){ case LineEndingKind_LF: { diff --git a/code/ship_files/config.4coder b/code/ship_files/config.4coder index 34015b2e..8a4b8775 100644 --- a/code/ship_files/config.4coder +++ b/code/ship_files/config.4coder @@ -40,7 +40,7 @@ mark_thickness = 2; lister_roundness = 20; // Code Wrapping -treat_as_code = ".cpp.c.hpp.h.cc.cs.java.rs.glsl.m.mm.js.ts.tsx.css.html.jai.json.mm"; +treat_as_code = ".cpp.c.hpp.h.cc.cs.java.rs.glsl.m.mm.js.ts.tsx.css.html.jai.json.mm.metal.glsl.hlsl"; enable_virtual_whitespace = false; virtual_whitespace_regular_indent = 2; enable_code_wrapping = false; diff --git a/project.4coder b/project.4coder index 7fd48469..a519d53c 100644 --- a/project.4coder +++ b/project.4coder @@ -25,7 +25,7 @@ commands = { .build = { .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .win = "code\\bin\\build.bat", .linux = "./code/bin/package.sh", - .mac = "./code/bin/package.sh", }, + .mac = "./code/bin/package-mac.sh", }, .run = { .out = "*run*", .footer_panel = false, .save_dirty_files = false, .win = "build\\4ed.exe", .linux = "build/4ed",