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

Replace CraftOS pager with a better one #16

Open
dmarcuse opened this issue May 29, 2018 · 6 comments
Open

Replace CraftOS pager with a better one #16

dmarcuse opened this issue May 29, 2018 · 6 comments

Comments

@dmarcuse
Copy link

textutils.pagedPrint and textutils.pagedTabulate are pretty bad, replacing them with a custom pager that can be scrolled properly (basically less) would be nice.

@SquidDev
Copy link
Member

SquidDev commented May 29, 2018

I'm not entirely sure how this will function with help. This prints each line in the file with a separate call to textutils.pagedPrint, which makes it much harder to have one unified pager.

For reference the following programs use these methods:

  • pagedTabulate: alias.lua, apis.lua, command/commands.lua, help.lua, list.lua, programs.lua
  • pagedPrint: help, set

Of these, help is the only one with funky handling.

@dmarcuse
Copy link
Author

In that case, why not just write a custom help program and set the path so that it's resolved first?

@SquidDev
Copy link
Member

SquidDev commented Jun 2, 2018

Yeah, I probably will. Might also PR that change into CC - there's a couple of other minor tweaks I'd like to make to the Lua side of things.

The other thing worth bearing in mind is whether the pager behaves like less or less -F, and if there's any situations we might want to disable it entirely. For instance, I'm not sure if list (ls/dir) should use a pager or just print everything to the terminal and allow people to scroll.

I guess I could provide some setting which allows people to control that (as well as program-specific control or something), but it seems a little cumbersome.

@dmarcuse
Copy link
Author

dmarcuse commented Jun 2, 2018

You could also replace the list program if necessary 😛

SquidDev added a commit that referenced this issue Jun 4, 2018
@Lupus590
Copy link
Contributor

@SquidDev
Copy link
Member

@Lupus590 Yep. Currently neither change really touches textutils.pagedTabulate, which is the other big function - I suspect that'll need to wait until I've reviewed cc-tweaked/CC-Tweaked#522.

Speaking of which, I haven't forgotten your PR, just laptop is currently dead, so there's a limit of how much work I can do.

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

No branches or pull requests

3 participants