peterbrittain / asciimatics

A cross platform package to do curses-like operations, plus higher level APIs and widgets to create text UIs and ASCII art animations
Apache License 2.0
3.62k stars 237 forks source link

Text widget should fully reset its state when a value changed #294

Closed zencd closed 3 years ago

zencd commented 3 years ago

To Reproduce Run the example attached. The example changes text in a text field in a cycle. The both text samples are longer then the screen's width, they has different length. Press any key 3+ times.

Expected behavior No right padding expected to be seen in the text field.

Describe the bug Instead, a right padding appears after 3 key strokes.

System details:

Proposed fix In Text::reset() add: self._start_column = 0 It gets fixed when this patch applied.

text_bug.txt

peterbrittain commented 3 years ago

OK. I see the problem and agree that's the fix. Will push something soon.