Panel Mode Operation

There are many times when editing a file (particularly a large one) where being able to view different portions of a file at the same time would be very helpful. There are several ways to accomplish this:

    • Open the file separately for browse or edit in some other editor, and arrange the two windows appropriately for viewing. This can work, but you lose the ability to use line commands to move / copy lines around, and only standard copy/paste operations can be used.


    • Use ‘exclude lines’ to hide the lines between the two areas so they ‘fit’ on the screen. However any scrolling actions tend to mess up the two view points.


    • SPFLite now has a screen mode we call PANEL mode. In this mode the screen is split horizontally or vertically into two ‘panels’. Each panel looks just like a normal SPFLite window, only smaller.

      So what does this enable you to do?

      • You can specify the ‘split point’ to whatever point you like. The two panels do not have to be the same size (See the KB Primitives (PanelH) and (PanelV) below).
      • You can scroll or reposition either panel independently of the other.
      • At any one time, only one of the panels is ‘active’. There is a single graphic line dividing the two panels. The 'active' panel will be displayed in the normal color scheme. The 'inactive' panel will have the text 'dimmed' to indicate the inactive status.  
      • So what does ‘active’ mean for a panel?
        • The Command > line is usable in the active panel.
        • Normal typing/editing can be performed only in the active panel.
        • Commands which cause the screen to scroll to a different location, will only move the active panel. e.g. CHANGE ALL XXX YYY will perform the change on the whole file, and will reposition only the active panel to the 1st changed line. Similarly for commands like FIND and LOCATE.
        • If both panels are viewing the same, or overlapping,  range of lines, activities such as normal typing will appear only in the active panel until some activity triggers an Attention (like (Enter)). At which time the opposite panel will be refreshed.
      • Switching between panels is simple, just mouse click in the desired panel, or hover and use mouse wheel scrolling in the panel. Or if you prefer a KB style swap, there is a new KB Primitive (PanelSwap) – which of course you will need to assign to a key using KEYMAP.
      • If you have the ScrollBar active, it will automatically switch to match the current position of the active panel. The ScrollBar itself can be used to scroll the active panel as usual.
      • Line commands can be used to Move/Copy/etc. between panels, just remember that the last line command entered will probably also have caused THAT panel to become the active panel.


Here’s a couple screenshots showing the same file, first with the upper panel active, the second with the lower active.






(PanelH) and (PanelV) KB Primitive

The (PanelH) and (PanelV) primitives control the split between the two Panels.  They respond to the location of the cursor when the (Panelx) primitive is entered.

    • A split panel display is created when the cursor is located in a 'reasonable' location. SPFLite requires that a panel must have at least 6 lines and/or 30 columns. If the cursor is in a location which would violate these minimums, the split will be made using a 60% / 40% ratio of the available space, with the 60% value used for the panel closest to the cursor location.
    • If the cursor is in a valid location, the split point will be created at the cursor location.  If the screen is already in split mode, the split mode will be moved to the new cursor location.
    • It is possible to switch between Horizontal panels and Vertical panels with a single (Panelx) request.


(PanelSwap) Primitive

The (PanelSwap) primitive is provided to allow you to swap between panels without using the mouse (for keyboard purists).


(PanelOff) Primitive


The (PanelOff) primitive simply cancels Panel mode and returns to a normal single panel edit screen.