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

Set number of choices lines to display #232

Closed
wants to merge 1 commit into from
Closed

Set number of choices lines to display #232

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 25, 2017

... sometimes a full screen list of choices is not desired (with disabled alternate screen):
numlines
while testing the code the cursor sometimes moves to home position: as the following fixes this

@@ -318,7 +324,7 @@ selected_choice(void)
                        if (tty_putc('\n') == EOF)
                                err(1, "tty_putc");
                        tty_putp(clr_eos, 1);
-                       tty_putp(tty_parm1(parm_up_cursor, choices_count + 1),
+                       tty_putp(tty_parm1(parm_up_cursor, choices_count - yscroll + 1),
                            1);
                } else if (choices_count > 0) {
                        /*

I think it's a "bug" in the original code ...

mptre added a commit that referenced this pull request Aug 27, 2017
How to re-produce, press PageDown repeatedly:

  $ env LINES=10 ./pick -X <LICENSE

Reported by Jenz Guenther in PR #232.
@mptre
Copy link
Owner

mptre commented Aug 27, 2017

You could use the LINES environment variable instead:

$ git ls-files | env LINES=10 pick -X | xargs less

Thanks for the bug report, fixed in 50e2748.

@mptre mptre closed this Aug 27, 2017
@ghost ghost deleted the lines branch August 27, 2017 16:05
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

Successfully merging this pull request may close these issues.

1 participant