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 99730 - RFE: Add option to search backwards
RFE: Add option to search backwards
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.1.1
Other All
: Normal enhancement
: ---
Assigned To: Gedit maintainers
gedit QA volunteers
: 100818 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-11-27 18:16 UTC by Reinout van Schouwen
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
preliminary patch w/o changelog entry (14.86 KB, patch)
2003-05-27 17:56 UTC, Eric Ritezel
none Details | Review
larger, more tested patch w/changelog (33.55 KB, patch)
2003-06-03 16:06 UTC, Eric Ritezel
none Details | Review
removed #ifdef's, spell plugin now working (34.90 KB, patch)
2003-06-04 01:24 UTC, Eric Ritezel
none Details | Review
updated patch to address suggestions 1-4 (35.11 KB, patch)
2003-06-05 07:24 UTC, Eric Ritezel
none Details | Review
patch updated to *correctly* address comment #1 (35.27 KB, patch)
2003-06-06 09:39 UTC, Eric Ritezel
none Details | Review

Description Reinout van Schouwen 2002-11-27 18:16:52 UTC
During today's UI-review it was suggested to add the option to search
backwards through a document. Paolo asked to file a bug report, so here it is.
Comment 1 Paolo Maggi 2003-04-24 15:03:43 UTC
Also a "Find Previous (Shift+Ctrl+G)" menu item should be added.
Comment 2 Paolo Maggi 2003-04-24 15:04:49 UTC
*** Bug 100818 has been marked as a duplicate of this bug. ***
Comment 3 Eric Ritezel 2003-05-27 17:56:55 UTC
Created attachment 16880 [details] [review]
preliminary patch w/o changelog entry
Comment 4 Paolo Maggi 2003-05-27 18:12:37 UTC
The patch looks quite good. A few comments:

1. find_again should be renamed find_next

2. we need a new find_previous function

3. Do we need a function to get last_search_was_search_backwards? Is
it really needed?

4. I'm not sure about the -1 in (but I could be wrong):
+		if (search_backwards)
+			gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (doc), &iter, -1);

5. Probably we need to think a more extensible signature for the
gedit_document_find function

6. We should add a Find Previous menu item 

7. IIRC, there are plugins using the find and find_again function (we
need to update them too)

Thanks again for the preliminary patch. It looks really good.
Comment 5 Eric Ritezel 2003-06-03 16:06:28 UTC
Created attachment 17100 [details] [review]
larger, more tested patch w/changelog
Comment 6 Eric Ritezel 2003-06-04 01:24:49 UTC
Created attachment 17119 [details] [review]
removed #ifdef's, spell plugin now working
Comment 7 Paolo Maggi 2003-06-04 13:26:37 UTC
The patch looks really good and it is quite ready for commit.

I still have a few comments:

1. gedit_cmd_search_find_prev duplicates almost completely the code of
   gedit_cmd_search_find_next. It should be easy to reduce code
duplication in 
   this case.
   
2. 
	+#define GEDIT_SEARCH_ENTIRE_WORD   	(1 << 0 )
	+#define GEDIT_SEARCH_BACKWARDS     	(1 << 4 )
	+#define GEDIT_SEARCH_CASE_SENSITIVE	(1 << 8 )
	+#define GEDIT_SEARCH_FROM_CURSOR   	(1 << 12)

   Why do you use 0, 4, 8, 12 instead of 0, 1, 2, 3 ?
   
3. The state of the "Search backwards" checkbutton is not restored
when you
   re-open the find/replace dialog.
   
4. IMO, in the find dialog the "Search backwards" checkbutton should
be above
   the "Wrap around" one.
   
5. I have found a little bug in my old code: open a new document. 
   Search->Find Next should be insensitive. Open the Find dialog. 
   Search for a text. Close the dialog. Search->Find Next is still
insensitive. 
   It should be sensitive.
   
Comment 8 Stephen Waters 2003-06-04 20:09:11 UTC
General comment: Please work with AbiWord, Galeon, etc. to standardize
on a Find/Replace dialogue. 
Comment 9 Eric Ritezel 2003-06-05 07:24:45 UTC
Created attachment 17159 [details] [review]
updated patch to address suggestions 1-4
Comment 10 Eric Ritezel 2003-06-06 09:39:55 UTC
Created attachment 17213 [details] [review]
patch updated to *correctly* address comment #1
Comment 11 Paolo Maggi 2003-06-13 15:25:32 UTC
Fixed in CVS HEAD.