Commit 53647d5c authored by Robert Roth's avatar Robert Roth Committed by Kai Willadsen

Implemented incremental search

https://bugzilla.gnome.org/show_bug.cgi?id=699486
parent 61f53b0c
......@@ -395,6 +395,8 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
if event.keyval == Gdk.KEY_Escape:
self.findbar.hide()
elif event.type == Gdk.EventType.KEY_RELEASE:
if event.keyval == Gdk.KEY_Return and self.keymask & MASK_SHIFT:
self.findbar.start_find_previous(self.focus_pane)
self.keymask &= ~mod_key
def on_style_updated(self, widget):
......
......@@ -61,14 +61,14 @@ class FindBar(gnomeglade.Component):
def start_find_next(self, textview):
self.textview = textview
if self.find_entry.get_text():
self.find_next_button.activate()
self.on_find_next_button_clicked(self.find_next_button)
else:
self.start_find(self.textview)
def start_find_previous(self, textview, text=None):
self.textview = textview
if self.find_entry.get_text():
self.find_previous_button.activate()
self.on_find_previous_button_clicked(self.find_previous_button)
else:
self.start_find(self.textview)
......@@ -121,6 +121,7 @@ class FindBar(gnomeglade.Component):
def on_find_entry_changed(self, entry):
entry.override_background_color(Gtk.StateType.NORMAL,
self.orig_base_color)
self._find_text(0)
def _find_text(self, start_offset=1, backwards=False, wrap=True):
match_case = self.match_case.get_active()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment