diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-11-28 17:15:08 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-11-28 17:15:08 +0100 |
| commit | 52ad03ef6f6bc746d9f3102ed9ac205d3125ad32 (patch) | |
| tree | 4a0a26d4ca935aa18abe6a7886049e0824c72c29 /src | |
| parent | 016ba5838f17c619da09b497e28269594b7393d2 (diff) | |
decide on newline style based on OS
Diffstat (limited to 'src')
| -rw-r--r-- | src/odin/printer/printer.odin | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/odin/printer/printer.odin b/src/odin/printer/printer.odin index 8a7aba6..a2dc0ef 100644 --- a/src/odin/printer/printer.odin +++ b/src/odin/printer/printer.odin @@ -58,15 +58,29 @@ Newline_Style :: enum { LF, } -default_style := Config { - spaces = 4, - newline_limit = 2, - convert_do = false, - tabs = true, - brace_style = ._1TBS, - indent_cases = false, - newline_style = .LF, - max_characters = 120, + +when ODIN_OS == "windows" { + default_style := Config { + spaces = 4, + newline_limit = 2, + convert_do = false, + tabs = true, + brace_style = ._1TBS, + indent_cases = false, + newline_style = .CRLF, + max_characters = 100, + } +} else { + default_style := Config { + spaces = 4, + newline_limit = 2, + convert_do = false, + tabs = true, + brace_style = ._1TBS, + indent_cases = false, + newline_style = .LF, + max_characters = 100, + } } make_printer :: proc(config: Config, allocator := context.allocator) -> Printer { |