Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Implement viewports / splits #5

Open
klange opened this issue Sep 5, 2018 · 2 comments
Open

Implement viewports / splits #5

klange opened this issue Sep 5, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@klange
Copy link
Owner

klange commented Sep 5, 2018

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 klange added the enhancement New feature or request label Sep 5, 2018
@klange
Copy link
Owner Author

klange commented Jun 10, 2019

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
Copy link
Owner Author

klange commented Jun 13, 2019

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant