GNOME Bugzilla – Bug 319137
Find Next in search doesn't account for scrolling
Last modified: 2006-02-19 21:07:28 UTC
Distribution/Version: Ubuntu 5.10 I expect "find next" to show the next match relative to my current scrolling position, so that if I've moved it after doing a search, it won't jump me back up to the one that's above me but after the last match.
Confirmed, this is annoying and should be changed.
Should not be hard to fix
Created attachment 59281 [details] [review] patch against cvs head with cvs diff up for #319137 Hello, It was indeed a easy fix. this patch is not perfect, because the search goes on the current page (and not on the current position). I think it will be better when #328102 will be fixed. I hope it will help. Thank you and have a nice day.
Hello, I am fool enough not to have thought about the "find previous" which has the same bug. I will submit a new patch very soon
Created attachment 59285 [details] [review] patch against cvs head with cvs diff up for #319137 Hello, a few remarks 1) when the user has scrolled to another page, the "find next" starts at the beginning of the page ( view->find_result = -1) 2) 1) when the user has scrolled to another page, the "find previous" starts at the bottom of the page ( view->find_result = n_results) Thank you
Perfect patch, Antoine. Let me take take the liberty and go a bit further. For me it seems that find page concept is useless, what will be if we'll try to remove view->find_page everywhere and replace it with view->current_page?
Hi Nickolay, I have also thought about removing view->find_page. Actually I think that the view->find_page is not interesting in itself (I haven't checked out all the code). The only interesting information brought by view->find_page is that the user has scrolled to another page, so the view->find_result must be adapted. Suppose you remove the view->find_page and you look for a word on the first page of a document. There 5 occurences of this word on the first page. You do "find next" on the 4 first occurences so view->find_result == 4. Then you scroll on the 5th page that has only 3 occurences of the word that you are looking for. As view->find_result > 3, the "find next" jumps to the 6th page. But perhaps you are interested by the occurences on the 5th page ... It depends on what behaviour you are expecting. So in my opinion the view->find_page is not usefull in itself but we should know when we arrive in the ev_find_next that user has scrolled to another page since the previous search (Perhaps this information is available elsewhere)
When users scrolls to another page, current page is changed accordingly and find_result is set to 0, look at page_changed_cb. Of course it's not perfect but I think we should try at least this behavior and improve it in the future. That is why path will be helpful.
Created attachment 59708 [details] [review] patch against cvs head with cvs diff up for #319137 Hello, this patch should fix bug #319137 (the bug #319134 is related, we should watch if the percent remaining search still gets stuck). A few comments: 0) find_page has been removed from the EvView structure 1) the function update_find_status_message has got a new parameter that tells whether the percent remaining to search or the number of occurences in the page should be displayed 2) in the function update_find_status_message , the message _("Not found") has been removed (it should have been "search finished" anyway) 3) the function jump_to_find_page has got a new parameter. It tells whether the search must begin on the current_page or on the current_page + 1 or on the current_page - 1 Have a nice day
I like this patch, perfect work. Thanks Antoine, it's committed.