Files
gnatstudio/examples/python/indent_all.py
Nicolas Roche 0dbfc04918 Conform to pep8 and pyflakes
Change-Id: If3a1aa9f0509c98f408673ed645d29ac009b2f82
2017-06-26 19:51:50 +01:00

18 lines
436 B
Python

"""This plug-in adds a menu Edit->Indent all files which will indent
automatically all source files from all projects"""
from GPS import Project, Menu, Console, EditorBuffer
def indent_all(menu):
for f in Project.root().sources(recursive=True):
ed = EditorBuffer.get(f)
ed.indent()
ed.save()
ed.close()
Console().write("Done indenting")
Menu.create("/Edit/Indent all files", indent_all)