The Editor has been enhanced to improve the ease with which individual functions and classes can be edited.
For single functions, the most obvious improvement is the outlining feature. Outlining identifies the blocks of code within control structures, and allows you to collapse and expand these blocks so that you can focus your attention on particular parts of the code
The picture below shows the result of opening the function ⎕SE.cbtop.TB_POPUP.
)ed ⎕SE.cbtop.TB_POPUP

Notice that the various control structure blocks are delineated by a treeview diagram.

Functions can be subdivided into Sections with :Section and :EndSection statements. Both statements may be followed by an optional and arbitrary name or description. The purpose is only to split the function up into sections that you can open and close in the Editor. Sections have no effect on the execution of the code
The following picture illustrates the use of sections in a function called DumpWindow. The function is divided into 5 sections named Comments, Init, NAs, MakeBitmap and CopyToClipBoard.
The first picture shows the function with all sections closed.

The next picture shows the effect of opening the Comments section. Notice how this is delineated by the statements:
:Section Comments ... :EndSection Comments

and with the Init section opened too:

Finally, with all the sections opened:

The picture below shows the result of opening the ComponentFile class. Notice how each function is delineated separately and that each function is individually line-numbered.
)ed ComponentFile
The outlining feature really comes into its own when editing classes because you can collapse and expand whole functions. The picture below shows the effect of collapsing all but the Append method.
When you edit a class, a separate treeview is optionally displayed in the left pane to make it easy to navigate within the class. When you click on a name in the treeview, the editor automatically scrolls the appropriate section into view (if necessary) and positions the edit cursor at its start. The picture below illustrates the result of opening the [Methods] section and then clicking on Rename.
Scripts can also be subdivided into Sections using :Section and :EndSection statements. As with single functions, the purpose is only to split the script up into sections that you can open and close in the Editor. Sections have no effect on the execution of the code.
The following picture illustrates a Class named actuarial which, for editing purposes, has been sub-divided into five separate Sections named Main, MenuHandlers, Validation, Utilities and OldCode. In this picture, all the Sections are closed.

The next picture shows the effect of opening just the Main section.

Notice that this section is delimited by the two statements:
:Section Main ... :EndSection Main
In this picture the 3 functions within the Main section are temporarily closed.
Similarly, the section called Validation is delimited by:
:Section Validation ... :EndSection Validation

If you double-click on the name of a Class in the Workspace Explorer, the same treeview is displayed to assist in navigation, as shown below.
The View menu, illustrated above, has been extended to allow you to control the new editor features, and now provides the following actions.
| Trace | Displays a column to the left of the function that displays ⎕TRACE settings |
| Stop | Displays a column to the left of the function that displays ⎕STOP settings |
| Monitor | Displays a column to the left of the function that displays ⎕MONITOR settings |
| Line Numbers | Toggles the display of line numbers on/off. |
| Function Line Numbers | Toggles the display of line numbers on individual functions on/off. This option is only enabled when editing a Class, Namespace script or Interface. |
| Tree View | Toggles the display of the treeview in the left-hand pane |
| Outlining | Turns outlining on and off. |
| Expand All Outlines | Expands all outlines. |
| Collapse All Outlines | Collapses all outlines |
| Expand all Outlines below here | Expands all outlines below the level of the current line. |
The manner in which the line numbering option works has changed.
In Version 12.1.the user's line-numbering preferences are stored in the Registry (in the Editor\Columns section) on a per object type basis. In other words, the system remembers the last line-numbering setting separately for a Class, function/operator, and each type of array; character vector, character matrix, vector of character vectors, and so forth.
The Line Numbers (Num-) menu item on the pop-up menu, and the button on the Session toolbar (both of which are associated with the system action [LineNumbers]) toggle line-numbering on/off on the current edit window as before. However, line numbering is not changed globally but only for the type of object in that window.
So, for example, if you have two Edit windows open, one on a function and the other on a character matrix, toggling the line numbers on and off in one window will have no effect on the line-numbering in the other window. However, if you opened a third window on a defined operator, toggling the line-numbering in that window would affect the line-numbering in the function window.
Whenever you change line-numbering, the corresponding value in the Registry for the type of object in the currently active edit window is immediately updated.
The lines_on_functions parameter, which used to control line-numbering on a global basis, has been removed.
The Function Line Numbers option in the pop-up Editor menu provides an additional level of line-numbering. If selected, line numbers are displayed independently on each individual function (or operator) in the Class. This option is only enabled when you are editing a Class, Namespace script or Interface, and is disabled for all other types of object.
Note that function line-numbering and general line-numbering are independent options and it is possible to have the entire Class numbered (from [0] to the number of lines in the Class) in addition to having line-numbering on each individual function.
Version 12.1 provides some simple refactoring tools.
If the input cursor is positioned on a word somewhere in the body of a script, and you select one of the options from the Refactoring menu:
the Editor inserts the appropriate template for a Field, Property or Method of the same name. The template is inserted immediately above the line containing the word. So, for example, if you position the input cursor on the word xvar, and then choose Add text as Property, the Editor will insert the following lines above the line in the script containing that xvar:
:Property xvar ∇r←get r←0 ∇ ∇set args ∇ :EndProperty
The following additional improvements have been made to the Editor: