From c938931e5eab9b9f621e8da15acaac10a4b0237e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=28t=29o=20Kohul=C3=A1k?= Date: Mon, 17 Oct 2022 07:21:29 +0200 Subject: [PATCH] Fix indent if line starts with & --- src/irpf90_indent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/irpf90_indent.py b/src/irpf90_indent.py index d8ab2c0..fe98a63 100755 --- a/src/irpf90_indent.py +++ b/src/irpf90_indent.py @@ -119,10 +119,12 @@ class indent(object): return l.strip().ljust(n) + ' :: '+ r.strip() def format_continuation(self,string,n): - buffer = string.split('&') + buffer = string.split('&', 1) if len(buffer) == 1: l = buffer[0] return l + elif buffer[0].strip() == "": + return self.format_continuation(buffer[1], n) else: l, r = buffer return l.strip().ljust(69-len(n)) + '&'+ r.strip()