Skip to content

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

@jpalus

Description

@jpalus

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions