bim icon indicating copy to clipboard operation
bim copied to clipboard

Implement viewports / splits

Open klange opened this issue 5 years ago • 2 comments

There's technically nothing really stopping us from showing multiple views of the same open file, to allow for things like splits, but there's some rendering and mouse input handling to worry about. We'll probably want to disable scrolling, or look into supporting scroll regions in ToaruOS's terminal as well...

klange avatar Sep 05 '18 12:09 klange

I have a rudimentary implementation of basic left-right splits. Currently only works when two buffers are open, and the split viewport will be between those two buffers (so at the moment, you can't have the same file on both sides).

Screenshot from 2019-06-10 22-34-32

klange avatar Jun 10 '19 13:06 klange

Another hack for having a split view on the same file has been added, and I've spent some time thinking about how to correctly handle all of this moving forward.

  • A new concept of view should be added. A view is over a particular buffer and is managed by some sort of layout system. views will have cursor locations, offsets, and a physical location on the screen. The layout engine will manage resizing views appropriately to fit the screen. In theory, more than two views should be supported with various split modes (vertical, horizontal, etc.).
  • Accesses to the global env (active buffer) should be removed. Methods should take a buffer (env) to operate on. When they need to perform redraws, they should query the layout manager to determine which views use that buffer.
  • Mouse handler should mostly be dealing with views and less with buffers.
  • The layout manager needs to understand tabs probably?

klange avatar Jun 13 '19 03:06 klange