Split Editor

From RAD Studio
Jump to: navigation, search

The Split Editor view allows using multiple editors side by side, above and below each other, or a mix, all in the same window. This includes dragging entire sets of tabs out to floating windows and back into the IDE. It also allows complex custom layouts and manipulation, meaning you can have a simple two-column layout, multiple-rows layout, or something customized exactly for your workflow. You can have multiple tabs open, all editing the same unit, and have multiple tabs open with a form designer in one tab plus one or more code tabs for the same unit. This includes moving which tab displays the designer. There is no limit to the number of split editors, horizontally or vertically.

Using Split Editor

You can access the split editor view by right-clicking a tab and choosing “Split >” or “Move >”. Split will create another version of the selected tab, while move will close the tab and open it in the selected place in your IDE.

=link

Alternatively, you can use Split Editor by dragging a file from the Projects view into an open editor tab. Also by right-clicking the project file, selecting the option Open in and choosing the editor tab where you want to open it.

Once two tabs are in a window, both sets have title bars.

With Split Editor, you can:

  • Drag an editor tab, or set of tabs, by dragging the title bar and docking it to any side of the IDE window.
  • Drag and dock it to any other existing editor's side (left, right, top, bottom).
  • Merge it with an existing set of tabs by dragging it over the center of an existing editor, including dragging a floating window of tabs to merge.
  • Drag it out to become its own window (either one tab or a set of tabs).

Most operations can be done on individual tabs, such as moving a tab between docked sets of tabs by dragging the individual tab from one location to another.

Each set of tabs can be dragged out to become its own window. Drag the title bar to move it.

Tip: You can hold Ctrl while dragging to ensure it does not try to dock.

Similarly, each window can be docked next to another set of tabs, to do this drag the title bar.

Note: Most editors/groups, when closed, will simply vanish. But the first editor, the one that used to be the only editor for the main window, when closed with the ‘X’ button, will close all the tabs it holds. Still, the space for it will remain open. The original editor can’t be closed and always has space on the screen. This won’t affect anything until you close tab groups. There is no visible impact when you create, move, or dock them in everyday work.

Split Editor Example.png

This is one of the many ways the Split Editor can be configured. It has an editor window on the left, two on the right and the panels are hidden from view but they pop up when hovered.

Designer and Code

Split editors allow the same file to be edited next to itself. Both editors have views over the same file contents. As you type in one, if you scroll to the same location, you will see the text appear in the other. Both views can be scrolled independently, allowing you to edit the same file in multiple locations. You can have any number of tabs editing the same file.

Note: Remember, there is only one file (module or file buffer in internal terms), but multiple editor views over that file. So, a change you make in one editor is always reflected in every other editor for the same file. A change made in one editor is not ‘copied’ or ‘duplicated’ or anything else: there is only one file and one content for that file, even if you have multiple editors viewing/editing that file.
Another way of saying this is that when you edit a file in one editor, that change is in the file itself, not the editor. This means that change is always present in the other editors also showing the same file.

Tips and Tricks

  • Save the configuration of editors as your desktop layout. Otherwise, you can spend considerable time setting up a layout and lose it.
Notes:
  • When the desktop layout changes, the configuration also changes, such as when the IDE starts debugging and switches to the Debug Layout.
  • When changing to other layout, any tab group that is not placed in the layout will be undocked to a floating window.
  • Turn on Options > Saving and Recovering > Save project desktop when closing and Save editor state when closing a tab any time
  • Saving editor state means it stores where it was scrolled to, what regions collapsed and expanded, etc. This is very useful when multiple editors of the same file are open. When you reopen your desktop and re-open the project (or just when reopening an editor that you closed earlier), the newly visible editor will display as it was when it was closed.
  • Consider unpinning the old-style dockable panes. This means they slide away to a small tab on any side of the main window. You can make them visible again by clicking the tab, and they’ll remain visible while focused. You can do this by clicking the pin button on the dockable pane title bar next to the X. This feature has existed for many years but was mostly useful when restricted to screen space. Now that multiple editors can be split and docked together, it can be really useful to unpin the side panes to make horizontal space.
  • Try to get into the habit of right-clicking a tab > Split > Right (or Left). Using multiple columns is probably the most common setup for split editors. Getting used to using this alone is incredibly powerful.
  • See Also