Skip to content

Commit

Permalink
better go support
Browse files Browse the repository at this point in the history
  • Loading branch information
pg83 committed Jul 24, 2022
1 parent 5405a72 commit bf71f61
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ted
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bf71f61

Please sign in to comment.