nicktrandafil / tags

Tag Input widget for Qt5
MIT License
40 stars 8 forks source link

fix issues with editing index. #4

Closed xvallspl closed 2 years ago

xvallspl commented 2 years ago
  1. fix wrong direction of comparison
  2. fix setting up new index when replacing the tags. Fixes out of bounds accesses and erasures when the new tags are fewer than the previous ones and reduces superfluous operations by setting the index directly
nicktrandafil commented 2 years ago

Thank you for spotting the bug! This fix breaks the no-empty-tags-apart-from-editing-tag invariant. I pushed a fix into the branch, please check.

xvallspl commented 2 years ago

Hi, nick. This didn't solve the problem for me after all. Let's see if I can can find time to find a reproducer.

nicktrandafil commented 2 years ago

Hi. I'll take look into this soon. I'm in the middle of some code re-organizing to reuse routines across the two widgets.

nicktrandafil commented 2 years ago

Hi @xvallspl. I have some middle-result in code re-organizing. Can you, please, check if your issue reproduces with the last changes?

xvallspl commented 2 years ago

My implementation has diverged from yours and I don't have a minimal reproducer (sorry, I don't have time for anything and I haven't debugged it yet). I will check the code and come back to you if I identify a change that I can port that solves it