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

Infinite loop when selecting entry with certain width relative to window width #426

Open
jpalus opened this issue Oct 29, 2022 · 1 comment

Comments

@jpalus
Copy link

jpalus commented Oct 29, 2022

Entries which end close to window border PathPicker cause infinite loop after trying to select them with either f or F.

Following for loop is affected:

for index in self.dirty_indexes:
y_pos = min_y + index + self.get_scroll_offset()
if min_y <= y_pos < max_y:
did_clear_line = True
self.clear_line(y_pos)
self.line_objs[index].output(self.color_printer)

Seemingly due to reaching this code path:

if important_text_length > space_for_printing:
# hrm, we need to update our decorated match to show
# a truncated version since right now we will print off
# the screen. lets also dump the beforeText for more
# space
self.update_decorated_match(max_len=space_for_printing)
self.is_truncated = True

Which apparently keeps adding dirty indexes forever:

if self.controller:
self.controller.dirty_line(self.index)

@jpalus
Copy link
Author

jpalus commented Oct 29, 2022

Reproduces for me with:

$ mkdir test-git
$ cd test-git
$ git init
# create file with name long enough relative to window width
$ echo test > $(printf 'f%.0s' `seq $(($(tput cols) - 10))`).txt
$ git status | fpp
# try to select file with 'F'

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

1 participant