From bf71f61e898c0def15e184a2bd6338487dfa2555 Mon Sep 17 00:00:00 2001 From: Anton Samokhvalov Date: Sun, 24 Jul 2022 20:21:36 +0300 Subject: [PATCH] better go support --- ted | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ted b/ted index 780eef9..e7a97b8 100755 --- a/ted +++ b/ted @@ -1126,9 +1126,13 @@ class Editor: def save(self, p): t = p + '.tmp' + r = self.t.result() + + if p.endswith('.go'): + r = r.replace(' ', '\t') with open(t, 'w') as f: - f.write(self.t.result()) + f.write(r) os.chmod(t, self.st_mode) os.rename(t, p)