Fix search broken by port because returns are now different (gtk2->gtk3 and vte 0.36 -> 0.38)

This commit is contained in:
Stephen Boddy 2015-06-21 04:23:52 +02:00
parent b0d4357002
commit b549f43834
1 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@
# GPL v2 only # GPL v2 only
"""searchbar.py - classes necessary to provide a terminal search bar""" """searchbar.py - classes necessary to provide a terminal search bar"""
from gi.repository import Gtk from gi.repository import Gtk, Gdk
from gi.repository import GObject from gi.repository import GObject
import re import re
@ -137,6 +137,8 @@ class Searchbar(Gtk.HBox):
self.searchrow+1, 0, self.searchrow+1, 0,
self.search_character) self.search_character)
buffer = buffer[0]
buffer = buffer[:buffer.find('\n')]
matches = self.searchre.search(buffer) matches = self.searchre.search(buffer)
if matches: if matches:
self.search_hit(self.searchrow) self.search_hit(self.searchrow)
@ -158,6 +160,8 @@ class Searchbar(Gtk.HBox):
self.searchrow+1, 0, self.searchrow+1, 0,
self.search_character) self.search_character)
buffer = buffer[0]
buffer = buffer[:buffer.find('\n')]
matches = self.searchre.search(buffer) matches = self.searchre.search(buffer)
if matches: if matches:
self.search_hit(self.searchrow) self.search_hit(self.searchrow)
@ -172,7 +176,7 @@ class Searchbar(Gtk.HBox):
self.next.show() self.next.show()
self.prev.show() self.prev.show()
def search_character(self, widget, col, row, junk): def search_character(self, widget, col, row):
"""We have to have a callback for each character""" """We have to have a callback for each character"""
return(True) return(True)