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

FX mode #129

Open
benbrittain opened this issue Feb 12, 2024 · 3 comments
Open

FX mode #129

benbrittain opened this issue Feb 12, 2024 · 3 comments

Comments

@benbrittain
Copy link

Is your feature request related to a problem? Please describe.
I'm using minus as a pager in a program where we would like functionality similar to less -FRX where it would be nice to have the output remain on screen after it exits (less -X) and automatically exit if the entire file can be displayed on the screen (less -F). This ideally would also mean not clearing prior scroll-back when the entire file or less can be displayed.

Describe the solution you'd like

I took a first pass at -X in #128 . I'm not sure what the right approach for -F is.

@AMythicDev
Copy link
Owner

I will work on the -F functionality. Please fix your code in #128.

@AMythicDev
Copy link
Owner

AMythicDev commented Feb 13, 2024

I cam up with a basic implementation of -F behaviour in minus but there are a couple of points to be noted.

  1. There will be a function like Pager::eof() to mark the end of data. Any further call to Pager::set_text() or Pager::push_str() will cause a panic. Other functions may work normally.
  2. Its best if we get the info about the data prior to the starting of the display (which means before calling dynamic_paging()/static_paging(). Otherwise if the display starts and then we call the Pager::eof() and then minus realises that the entire data can be fit in the screen without a display, it will close the display and rewrite the text on the normal screen which is sort of wonky.

@AMythicDev
Copy link
Owner

@benbrittain hey man I just wanted to give a reminder that you fix #128 because I also have to merge #65 which is quite big and I am sure it will cause merge conflicts with your PR and you're gonna have to double the effort to fix ci as well as fix the merge conflicts. Also I have to test the PR to ensure it works all to well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants