diff --git a/.editorconfig b/.editorconfig index df5214ff8c..e0291f737e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,6 @@ indent_size = 2 [{Makefile,*.mk}] indent_style = tab + +[*.msg] +indent_style = tab diff --git a/tools/msg/parse_compile.py b/tools/msg/parse_compile.py index 649dedd468..30239cb18a 100755 --- a/tools/msg/parse_compile.py +++ b/tools/msg/parse_compile.py @@ -388,7 +388,7 @@ if __name__ == "__main__": explicit_end = False while len(source) > 0: - if source[0] == "\r": + if source[0] == "\r" or source[0] == "\t": source = source[1:] continue @@ -397,7 +397,7 @@ if __name__ == "__main__": source = source[1:] for i in range(indent_level): - if source[0] == " " or source[0] == "\t": + if source[0] == "\t": source = source[1:] else: break @@ -452,14 +452,12 @@ if __name__ == "__main__": # count indent level indent_level = 0 + """ while source[0] == " " or source[0] == "\t" or source[0] == "\n" or source[0] == "\r": if source[0] == " " or source[0] == "\t": indent_level += 1 source = source[1:] - - # TODO: lookahead at all lines until "}" to determine lowest indent value - if indent_level == 4: - break + """ else: command, args, source = parse_command(source) diff --git a/tools/splat_ext/PaperMarioMessages.py b/tools/splat_ext/PaperMarioMessages.py index 4ab16f8a00..22a6704816 100644 --- a/tools/splat_ext/PaperMarioMessages.py +++ b/tools/splat_ext/PaperMarioMessages.py @@ -410,9 +410,9 @@ class N64SegPaperMarioMessages(N64Segment): break if msg_name is None: - self.f.write(f"#message:{i:02X}:{j:03X} {{\n ") + self.f.write(f"#message:{i:02X}:{j:03X} {{\n\t") else: - self.f.write(f"#message:{i:02X}:({msg_name}) {{\n ") + self.f.write(f"#message:{i:02X}:({msg_name}) {{\n\t") self.write_message_markup(data[msg_offset:]) self.f.write("\n}\n") @@ -470,7 +470,7 @@ class N64SegPaperMarioMessages(N64Segment): self.write_markup("[end]") def write_markup(self, markup): - self.f.write(re.sub("\n", "\n ", markup)) + self.f.write(re.sub("\n", "\n\t", markup)) if markup == "[font:title]\n" or markup == "[font:subtitle]\n": self.root_charset = CHARSET_CREDITS