Skip to content
Commit 50332645 authored by Gary Li's avatar Gary Li Committed by António Fernandes
Browse files

batch-rename-dialog: fix tag intersection for zero-length deletions

Dead keys insert a provisional visual indication, which looks like a
text insertion, but is actually signaled as `::delete-text`. Unlike
regular emissions of `::delete-text`, here the start and end positions
are exactly the same (so you know nothing is actually deleted).

Nautilus deletes the neighbouring tag
When a dead key is entered into the batch rename entry, it deletes 
the neighbouring tag. This occurs for just before, inside and just
after the tag.

This happens because our logic for knowing when to delete special
text tags is assuming end_position > start_position, which is not
the case with dead keys.

Add conditions to ensure intersecting selections cannot be zero-length.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2821


(cherry picked from commit ce367695)
parent b643a00b
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