Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support scrolling viewport vertically without affecting cursor location. #2

Open
ta0kira opened this issue Apr 15, 2020 · 1 comment
Labels
enhancement New feature or request WEditor

Comments

@ta0kira
Copy link
Owner

ta0kira commented Apr 15, 2020

It's often useful to scroll to another part of the document to check on something without losing the cursor position. Right now this isn't possible with FixedWidthEditor and FixedWidthViewer.

I think the implementation would be something like this:

  • Add a new function to FixedFontViewer for actions to change the view, e.g., move up or down by n lines.
  • The getCursor return probably needs to be made Maybe (Int,Int) to disable its display.
  • In the implementation of Document:
    • Add a Maybe (Preview c b) field, where data Preview is just a line zipper containing the whole doc.
    • If the preview exists, use that for visible lines, and don't show the cursor.
    • If edits happen or if the cursor is moved (to include width resizing), set the preview to Nothing.
@ta0kira ta0kira added the enhancement New feature or request label Apr 15, 2020
@ta0kira
Copy link
Owner Author

ta0kira commented Apr 17, 2020

This was partially fixed with 1bc9f7f; however, the implementation for EditingDocument doesn't support scrolling the cursor out of view.

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

No branches or pull requests

1 participant