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 711512 - Search Text in Editor
Search Text in Editor
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: document-manager
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Anjuta maintainers
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-05 18:54 UTC by Kriti
Modified: 2013-11-08 20:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch Search Text in Editor (1.45 KB, patch)
2013-11-05 19:11 UTC, Kriti
needs-work Details | Review
Modified Patch (1.44 KB, patch)
2013-11-06 14:10 UTC, Kriti
none Details | Review
Modified Patch (1.44 KB, patch)
2013-11-06 14:20 UTC, Kriti
needs-work Details | Review
Added g_object_unref (selection_start) for avoiding memory leak (1.47 KB, patch)
2013-11-06 18:26 UTC, Kriti
committed Details | Review

Description Kriti 2013-11-05 18:54:15 UTC
In the editor window when we search a Text (using Ctrl+f) like "Ty" and the file has text "Td" , the string "Td" is matched and colored since it has matched "T" of both the strings. But "Td" should not be colored as it is not equal to the search string "Ty" even if some part of it as matched "Td".
Comment 1 Kriti 2013-11-05 19:11:42 UTC
Created attachment 259041 [details] [review]
Patch  Search Text in Editor
Comment 2 André Klapper 2013-11-06 10:09:42 UTC
Comment on attachment 259041 [details] [review]
Patch  Search Text in Editor

Thanks for your patch. Please fix the style issue by using the same style as the surrounding code when it comes to whitespaces between commas, equal signs, function names and brackets; plus make sure to use the same indentation length plus tabs vs. spaces. This is inconsistent in your patch.
Comment 3 Kriti 2013-11-06 14:10:06 UTC
Created attachment 259081 [details] [review]
Modified Patch
Comment 4 Kriti 2013-11-06 14:20:44 UTC
Created attachment 259082 [details] [review]
Modified Patch
Comment 5 Johannes Schmid 2013-11-06 17:21:36 UTC
Review of attachment 259082 [details] [review]:

Keep in mind that GObject/C uses explicit memory management, so most objects are not free'd automatically and you have to reduce their refcount by g_object_unref().

But looks good otherwise - thanks!

::: plugins/document-manager/search-box.c
@@ +577,3 @@
+                	ianjuta_editor_selection_set (selection,
+                                              IANJUTA_ITERABLE (selection_start),
+                                              IANJUTA_ITERABLE (selection_start), TRUE, NULL);

As far as I can see to need to add a g_object_unref (selection_start) to avoid a memory leak.
Comment 6 Kriti 2013-11-06 18:26:03 UTC
Created attachment 259134 [details] [review]
Added g_object_unref (selection_start) for avoiding memory leak
Comment 7 Johannes Schmid 2013-11-08 20:35:02 UTC
Review of attachment 259134 [details] [review]:

Thanks!

You still have whitespace issues in your patch (which I fixed). Please stick to the indentation used in the files, e.g. just leave auto-indentation in anjuta enabled as it is by default and if in doubt, select the text you changed and type <Ctrl-I> to indent it automatically.