summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-10-19 10:45:34 -0400
committerpommicket <pommicket@gmail.com>2023-10-19 10:45:34 -0400
commit69d702f2076930b8cc88c73420fc849eb4b807ce (patch)
tree41547166457ba5b0710f077f98eba3ae37872404 /config.c
parent30f37caf7d9facf7698d01ef77d7da93e7316103 (diff)
editorconfig seems to be working
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/config.c b/config.c
index d6b3eca..abb6e34 100644
--- a/config.c
+++ b/config.c
@@ -1459,6 +1459,7 @@ static void config_read_editorconfig(Ted *ted, RcStr *path_rc) {
}
const int value_int = atoi(value);
if (cfg && streq(key, "indent_style")) {
+ str_ascii_to_lowercase(value);
if (streq(value, "tab"))
config_set_bool(cfg, &setting_indent_with_spaces, false);
else if (streq(value, "space"))
@@ -1466,6 +1467,7 @@ static void config_read_editorconfig(Ted *ted, RcStr *path_rc) {
} else if (cfg && (streq(key, "indent_size") || streq(key, "tab_width")) && value_int > 0 && value_int < 255) {
config_set_u8(cfg, &setting_tab_width, (u8)value_int);
} else if (cfg && streq(key, "end_of_line")) {
+ str_ascii_to_lowercase(value);
if (streq(value, "lf")) {
config_set_bool(cfg, &setting_crlf, false);
config_set_bool(cfg, &setting_crlf_windows, false);
@@ -1474,12 +1476,14 @@ static void config_read_editorconfig(Ted *ted, RcStr *path_rc) {
}
// who the fuck uses CR line endings in the 21st century??
} else if (cfg && streq(key, "insert_final_newline")) {
+ str_ascii_to_lowercase(value);
if (streq(value, "true")) {
config_set_bool(cfg, &setting_auto_add_newline, true);
} else if (streq(value, "false")) {
config_set_bool(cfg, &setting_auto_add_newline, false);
}
} else if (cfg && streq(key, "trim_trailing_whitespace")) {
+ str_ascii_to_lowercase(value);
if (streq(value, "true")) {
config_set_bool(cfg, &setting_remove_trailing_whitespace, true);
} else if (streq(value, "false")) {