This file is indexed.

/usr/share/gps/library/formatfile.py is in gnat-gps-common 6.1.2016-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
This plug-in provides a new menu to reformat the whole buffer.
Select /Edit/Format Whole File
or create a keybinding to the Editor/Format Whole File action via
the menu /Edit/Key Shortcuts.

This is basically the same thing as "Select All", followed by
"Format Selection", but this preserves the current location of the
cursor, which Select All cannot do.
"""


import GPS
import gps_utils


@gps_utils.interactive(category="Editor",
                       name="Format Whole File",
                       menu="/Edit/Format Whole File",
                       after="/Edit/Format Selection")
@gps_utils.with_save_excursion
def format_whole_file():
    buf = GPS.EditorBuffer.get()
    buf.select(buf.beginning_of_buffer(), buf.end_of_buffer())
    GPS.execute_action("Format Selection")