[snippets] Deactivate snippet when collapsed

This removes the snippet as soon as the begin and end
markers of the snippet have collapsed onto each other

https://bugzilla.gnome.org/show_bug.cgi?id=612663