After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 334305 - Snippet disappears after reverting
Snippet disappears after reverting
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
git master
Other All
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-12 12:55 UTC by jessevdk@gmail.com
Modified: 2019-03-23 20:35 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Fix disappearing snippet after reverting (694 bytes, patch)
2006-03-22 23:12 UTC, jessevdk@gmail.com
accepted-commit_now Details | Review

Description jessevdk@gmail.com 2006-03-12 12:55:08 UTC
Please describe the problem:
When I change a system snippet in the snippets manager and revert that snippet
it disappears after I reopen the dialog.

Steps to reproduce:
1. Change a snippet
2. Revert the snippet
3. Close the dialog and reopen the dialog


Actual results:
The original snippet doesn't show up

Expected results:
The original snippet does show up

Does this happen every time?
No, it happens only if the reverted snippet is the only snippet in that language
that is overloaded/overridden by the user

Other information:
Comment 1 jessevdk@gmail.com 2006-03-12 13:10:13 UTC
This happens because when the user snippet is removed when reverting the user library is removed if it was the last snippet in there. This will also remove the snippet itself from the container. The revert does not put the snippet back in because in all other cases the snippet just stays. I'll put up a fix in short time.
Comment 2 jessevdk@gmail.com 2006-03-22 23:12:10 UTC
Created attachment 61804 [details] [review]
Fix disappearing snippet after reverting

This simple patch fixes the disappearance of a snippet when it is reverted and it is the last user snippet in the language. The fix simply sets the library of the snippet back to the system library before removing the snippet from the user library, thus not causing it to be removed itself when the user library (and all its snippets) is removed from the container.
Comment 3 Paolo Maggi 2006-03-23 07:38:32 UTC
The patch looks good to me.
Please, commit.

Jesse: Feel free to commit simple bug fixes like this one without asking for permission. Only send a note to us about the committed patch. Please, don't commit new features or feature enhancements until we branch for 2.15.
Comment 4 Paolo Maggi 2006-03-23 10:39:54 UTC
Committed since Jesse still has problem with his CVS account.