diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-29 23:09:14 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-29 23:09:14 +0200 |
| commit | 9b19888219305c3740f36d9490e08e04e148a413 (patch) | |
| tree | 47f83a71694d01c5db0ea1f12e0e849926fd3458 | |
| parent | 86e35a09c3c2e18e7cd4c73b7300f5236c9aa17e (diff) | |
Remove Maybe for now because json serialization messes it up.
| -rw-r--r-- | src/common/config.odin | 4 | ||||
| -rw-r--r-- | src/server/format.odin | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/common/config.odin b/src/common/config.odin index c510e57..d90e5fa 100644 --- a/src/common/config.odin +++ b/src/common/config.odin @@ -27,8 +27,8 @@ Config :: struct { Format_Config :: struct { tabs: bool, - characters: Maybe(int), - spaces: Maybe(int), + characters: int, + spaces: int, } config: Config;
\ No newline at end of file diff --git a/src/server/format.odin b/src/server/format.odin index 219d7d9..041b204 100644 --- a/src/server/format.odin +++ b/src/server/format.odin @@ -22,12 +22,12 @@ get_complete_format :: proc(document: ^common.Document, config: ^common.Config) style := printer.default_style style.tabs = config.formatter.tabs - if characters, ok := config.formatter.characters.(int); ok { - style.max_characters = characters + if config.formatter.characters != 0 { + style.max_characters = config.formatter.characters } - if spaces, ok := config.formatter.spaces.(int); ok { - style.spaces = spaces + if config.formatter.spaces != 0 { + style.spaces = config.formatter.spaces } prnt := printer.make_printer(style, context.temp_allocator) |