[Bugs] #398 NORM: View Source: search support

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Sat Mar 20 06:42:28 EDT 2010


#398: View Source: search support
-----------------------------+----------------------------------------------
    Reporter:  sascha_silbe  |          Owner:  timClicks        
        Type:  enhancement   |         Status:  accepted         
    Priority:  Normal        |      Milestone:  0.90             
   Component:  sugar         |        Version:  Git as of bugdate
    Severity:  Minor         |       Keywords:  sugar-love       
Distribution:  Unspecified   |   Status_field:  New              
-----------------------------+----------------------------------------------

Comment(by timclicks):

 Replying to [comment:6 timclicks]:
 >  Problems::
 >   Non-greedy search. Stops after encountering the first match.
 >

 This isn't actually correct. There function stops at an optional limit. So
 this approach looks fine to use.


 <silbe> timClicks: can you time-bound
 gtksourceview2.iter_forward_search(), e.g. by letting it search only up to
 a maximum distance / certain point in the text?
 <timClicks> yes
 <timClicks> it has a limit argument
 <timClicks> i'll check, but I'm fairly certain it's byte-bound, not time-
 bound
 <silbe> timClicks: then my first suggestion would be to run it (if
 necessary repeatedly) in the "idle" loop.
 <silbe> timClicks: doing it this way evades almost all of the pitfalls of
 multithreading / multiprocessing
 <timClicks> i see
 <timClicks> does that loop only do something if nothing else requests cpu
 time?
 * timClicks thinks of boinc/seti at home as an analogy
 <silbe> timClicks: if you like, you can measure the time the call took and
 tweak the number of bytes, or call it repeatedly until the time limit is
 reached. The only important thing is to bound the maximum time it takes
 well enough to make the GUI feel responsive.
 <timClicks> i see
 <timClicks> i wanted the gui to be such that you didn't need to hit Ctrl+F
 <timClicks> e.g. if you have view source open, you start typing
 <timClicks> once you push esc, the string clears
 <silbe> timClicks: it's called whenever the GUI main loop is "idle" (i.e.
 not processing user actions or invoking callbacks); it doesn't depend on
 the behaviour of other processes or threads.
 <silbe> timClicks: ah, so iterative search. very nice.
 <silbe> timClicks: oh, and please change to cursor (tomeu posted a link on
 sugar-devel some days ago) while it's searching / doing highlighting in
 the background so the user knows the input was accepted

-- 
Ticket URL: <https://bugs.sugarlabs.org/ticket/398#comment:7>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list