batch-rename-dialog: use positions for tag handling

When a tag is added, deleted or moved or a text is changed, inserted
or deleted, we need to do update the text and tags already present
based on what changed.

We were checking whether a tag was present or not matching with the
text rather than deterministically adding, removing or updating the
positions based on the direct user interaction.

Doing it in this way is a potential problem since two tags added
writing manually would confuse the underlying handling, apart of being
harder to have a consistent state of the tags like deleting multiple
tags at once, deleting tags with text on the sides when selected,
replacing tags with text, crashes when using overwrite mode instead of
insertion mode, or crashes when using modifiers. Apart of making the
handling more complex.

This patch refactors the tag handling for using positions and direct
manipulation of them instead of text.
parent 1d397ba0
This diff is collapsed.
......@@ -110,9 +110,9 @@
<property name="width_request">400</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<signal name="changed" handler="file_names_widget_entry_on_changed" swapped="yes" />
<signal name="activate" handler="file_names_widget_on_activate" swapped="yes" />
<signal name="key-press-event" handler="on_key_press_event" swapped="no"/>
<signal name="insert-text" handler="on_insert_text" swapped="no" />
<signal name="delete-text" handler="on_delete_text" swapped="no" />
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment