Opened 15 years ago

Closed 11 years ago

Last modified 11 years ago

#398 closed enhancement (wontfix)

View Source: search support

Reported by: sascha_silbe Owned by: timClicks
Priority: Normal Milestone:
Component: Sugar Version: Git as of bugdate
Severity: Minor Keywords: sugar-love
Cc: smparrish Distribution/OS: Unspecified
Bug Status: New

Description

It would be very useful to be able to search inside the "View Source" window.

Change History (12)

comment:1 Changed 15 years ago by tomeu

  • Bug Status changed from Unconfimed to New
  • Milestone changed from Unspecified by Release Team to 0.86
  • Priority changed from Unspecified by Maintainer to Normal
  • Severity changed from Unspecified to Minor

comment:2 Changed 15 years ago by homunq

  • Keywords sugar-love added

comment:3 Changed 15 years ago by erikos

  • Milestone changed from 0.86 to 0.88
  • Owner changed from marcopg to tomeu
  • Status changed from new to assigned

comment:4 Changed 14 years ago by timClicks

  • Owner changed from tomeu to timClicks
  • Status changed from assigned to accepted

comment:5 Changed 14 years ago by tomeu

  • Milestone changed from 0.88 to 0.90

comment:6 follow-up: Changed 14 years ago by timclicks

Update - Implementation notes:

Gtk.TextIter
Returns a tuple of line number, start & stop position.
gtksourceview2.Buffer.forward_iter_to_source_mark
is an implementation within the gtksourceview module.
Problems
Non-greedy search. Stops after encountering the first match.

comment:7 in reply to: ↑ 6 Changed 14 years ago by timclicks

Replying to 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@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

comment:8 follow-up: Changed 13 years ago by smparrish

  • Cc smparrish added

timclicks can you provide an update as to where you are with this.

comment:9 Changed 13 years ago by smparrish

  • seeta_dev set to Shanjit, Dipankar

comment:10 in reply to: ↑ 8 Changed 13 years ago by timclicks

Replying to smparrish:

timclicks can you provide an update as to where you are with this.

smparrish I haven't updated anything since the last comment. Feel free to take over.

comment:11 Changed 11 years ago by dnarvaez

  • Resolution set to wontfix
  • Status changed from accepted to closed

Patches welcome but this doesn't seem to be high priority and it has not been implemented for 3 years.

comment:12 Changed 11 years ago by dnarvaez

  • Milestone 0.90 deleted

Milestone 0.90 deleted

Note: See TracTickets for help on using tickets.