/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to annotate/gannotate.py

  • Committer: Jelmer Vernooij
  • Date: 2008-03-28 19:26:53 UTC
  • mto: (450.1.13 trunk)
  • mto: This revision was merged to the branch mainline in revision 458.
  • Revision ID: jelmer@samba.org-20080328192653-trzptkwahx1tulz9
Add module for preferences code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import time
18
18
 
19
 
from gi.repository import GObject
20
 
from gi.repository import Gdk
21
 
from gi.repository import Gtk
22
 
from gi.repository import Pango
 
19
import pygtk
 
20
pygtk.require("2.0")
 
21
import gobject
 
22
import gtk
 
23
import pango
23
24
import re
24
25
 
25
 
from bzrlib import patiencediff
 
26
from bzrlib import patiencediff, tsort
26
27
from bzrlib.errors import NoSuchRevision
27
28
from bzrlib.revision import NULL_REVISION, CURRENT_REVISION
28
29
 
29
 
from bzrlib.plugins.gtk.annotate.colormap import AnnotateColorSaturation
 
30
from colormap import AnnotateColorMap, AnnotateColorSaturation
30
31
from bzrlib.plugins.gtk.revisionview import RevisionView
31
32
from bzrlib.plugins.gtk.window import Window
32
33
 
44
45
class GAnnotateWindow(Window):
45
46
    """Annotate window."""
46
47
 
47
 
    def __init__(self, all=False, plain=False, parent=None, branch=None):
 
48
    def __init__(self, all=False, plain=False, parent=None):
48
49
        self.all = all
49
50
        self.plain = plain
50
 
        self._branch = branch
51
 
 
52
 
        super(GAnnotateWindow, self).__init__(parent=parent)
53
 
 
54
 
        self.set_icon(
55
 
            self.render_icon_pixbuf(Gtk.STOCK_FIND, Gtk.IconSize.BUTTON))
 
51
        
 
52
        Window.__init__(self, parent)
 
53
        
 
54
        self.set_icon(self.render_icon(gtk.STOCK_FIND, gtk.ICON_SIZE_BUTTON))
56
55
        self.annotate_colormap = AnnotateColorSaturation()
57
56
 
58
57
        self._create()
68
67
        self.revisionview.set_file_id(file_id)
69
68
        self.revision_id = getattr(tree, 'get_revision_id', 
70
69
                                   lambda: CURRENT_REVISION)()
71
 
 
 
70
        
72
71
        # [revision id, line number, author, revno, highlight color, line]
73
 
        self.annomodel = Gtk.ListStore(GObject.TYPE_STRING,
74
 
                                       GObject.TYPE_INT,
75
 
                                       GObject.TYPE_STRING,
76
 
                                       GObject.TYPE_STRING,
77
 
                                       GObject.TYPE_STRING,
78
 
                                       GObject.TYPE_STRING)
79
 
 
 
72
        self.annomodel = gtk.ListStore(gobject.TYPE_STRING,
 
73
                                       gobject.TYPE_STRING,
 
74
                                       gobject.TYPE_STRING,
 
75
                                       gobject.TYPE_STRING,
 
76
                                       gobject.TYPE_STRING,
 
77
                                       gobject.TYPE_STRING)
 
78
        
80
79
        last_seen = None
81
80
        try:
82
81
            branch.lock_read()
86
85
            for revision_id, revno in revno_map.iteritems():
87
86
                self.dotted[revision_id] = '.'.join(str(num) for num in revno)
88
87
            for line_no, (revision, revno, line)\
89
 
                in enumerate(self._annotate(tree, file_id)):
 
88
                    in enumerate(self._annotate(tree, file_id)):
90
89
                if revision.revision_id == last_seen and not self.all:
91
90
                    revno = author = ""
92
91
                else:
93
92
                    last_seen = revision.revision_id
94
 
                    author = ", ".join(revision.get_apparent_authors())
 
93
                    author = revision.get_apparent_author()
95
94
 
96
95
                if revision.revision_id not in self.revisions:
97
96
                    self.revisions[revision.revision_id] = revision
102
101
                                       revno,
103
102
                                       None,
104
103
                                       line.rstrip("\r\n")
105
 
                                       ])
 
104
                                      ])
106
105
                self.annotations.append(revision)
107
106
 
108
107
            if not self.plain:
125
124
            # bar?
126
125
            print("gannotate: Line number %d does't exist. Defaulting to "
127
126
                  "line 1." % lineno)
128
 
            return
 
127
            return
129
128
        else:
130
129
            row = lineno - 1
131
130
 
132
 
        tree_path = Gtk.TreePath(path=row)
133
 
        self.annoview.set_cursor(tree_path, None, False)
134
 
        self.annoview.scroll_to_cell(tree_path, use_align=True)
 
131
        self.annoview.set_cursor(row)
 
132
        self.annoview.scroll_to_cell(row, use_align=True)
 
133
 
135
134
 
136
135
    def _annotate(self, tree, file_id):
137
136
        current_revision = FakeRevision(CURRENT_REVISION)
139
138
        current_revision.timestamp = time.time()
140
139
        current_revision.message = '[Not yet committed]'
141
140
        current_revision.parent_ids = tree.get_parent_ids()
142
 
        current_revision.properties['branch-nick'] = self.branch._get_nick(local=True)
 
141
        current_revision.properties['branch-nick'] = self.branch.nick
143
142
        current_revno = '%d?' % (self.branch.revno() + 1)
144
143
        repository = self.branch.repository
145
144
        if self.revision_id == CURRENT_REVISION:
167
166
    def _highlight_annotation(self, model, path, iter, now):
168
167
        revision_id, = model.get(iter, REVISION_ID_COL)
169
168
        revision = self.revisions[revision_id]
170
 
        # XXX sinzui 2011-08-12: What does get_color return?
171
 
        color = self.annotate_colormap.get_color(revision, now)
172
 
        model.set_value(iter, HIGHLIGHT_COLOR_COL, color)
 
169
        model.set(iter, HIGHLIGHT_COLOR_COL,
 
170
                  self.annotate_colormap.get_color(revision, now))
173
171
 
174
172
    def _selected_revision(self):
175
173
        (path, col) = self.annoview.get_cursor()
179
177
 
180
178
    def _activate_selected_revision(self, w):
181
179
        rev_id = self._selected_revision()
182
 
        if not rev_id or rev_id == NULL_REVISION:
 
180
        if rev_id is None:
183
181
            return
184
182
        selected = self.revisions[rev_id]
185
183
        self.revisionview.set_revision(selected)
194
192
        self.revisionview = self._create_log_view()
195
193
        self.annoview = self._create_annotate_view()
196
194
 
197
 
        vbox = Gtk.VBox(homogeneous=False, spacing=0)
 
195
        vbox = gtk.VBox(False)
198
196
        vbox.show()
199
197
 
200
 
        sw = Gtk.ScrolledWindow()
201
 
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
202
 
        sw.set_shadow_type(Gtk.ShadowType.IN)
 
198
        sw = gtk.ScrolledWindow()
 
199
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
 
200
        sw.set_shadow_type(gtk.SHADOW_IN)
203
201
        sw.add(self.annoview)
204
202
        self.annoview.gwindow = self
205
203
        sw.show()
206
204
 
207
 
        swbox = Gtk.VBox()
208
 
        swbox.pack_start(sw, True, True, 0)
 
205
        swbox = gtk.VBox()
 
206
        swbox.pack_start(sw)
209
207
        swbox.show()
210
208
 
211
 
        hbox = Gtk.HBox(homogeneous=False, spacing=6)
 
209
        hbox = gtk.HBox(False, 6)
212
210
        self.back_button = self._create_back_button()
213
 
        hbox.pack_start(self.back_button, False, True, 0)
 
211
        hbox.pack_start(self.back_button, expand=False, fill=True)
214
212
        self.forward_button = self._create_forward_button()
215
 
        hbox.pack_start(self.forward_button, False, True, 0)
216
 
        self.find_button = self._create_find_button()
217
 
        hbox.pack_start(self.find_button, False, True, 0)
218
 
        self.goto_button = self._create_goto_button()
219
 
        hbox.pack_start(self.goto_button, False, True, 0)
 
213
        hbox.pack_start(self.forward_button, expand=False, fill=True)
220
214
        hbox.show()
221
 
        vbox.pack_start(hbox, False, True, 0)
222
 
 
223
 
        self.pane = pane = Gtk.Paned.new(Gtk.Orientation.VERTICAL)
 
215
        vbox.pack_start(hbox, expand=False, fill=True)
 
216
        
 
217
        self.pane = pane = gtk.VPaned()
224
218
        pane.add1(swbox)
225
219
        pane.add2(self.revisionview)
226
220
        pane.show()
227
 
        vbox.pack_start(pane, True, True, 0)
 
221
        vbox.pack_start(pane, expand=True, fill=True)
228
222
 
229
223
        self._search = SearchBox()
230
 
        swbox.pack_start(self._search, False, True, 0)
231
 
        accels = Gtk.AccelGroup()
232
 
        accels.connect(Gdk.KEY_f, Gdk.ModifierType.CONTROL_MASK,
233
 
                             Gtk.AccelFlags.LOCKED,
 
224
        swbox.pack_start(self._search, expand=False, fill=True)
 
225
        accels = gtk.AccelGroup()
 
226
        accels.connect_group(gtk.keysyms.f, gtk.gdk.CONTROL_MASK,
 
227
                             gtk.ACCEL_LOCKED,
234
228
                             self._search_by_text)
235
 
        accels.connect(Gdk.KEY_g, Gdk.ModifierType.CONTROL_MASK,
236
 
                             Gtk.AccelFlags.LOCKED,
 
229
        accels.connect_group(gtk.keysyms.g, gtk.gdk.CONTROL_MASK,
 
230
                             gtk.ACCEL_LOCKED,
237
231
                             self._search_by_line)
238
232
        self.add_accel_group(accels)
239
233
 
240
234
        self.add(vbox)
241
235
 
242
 
    def _search_by_text(self, *ignored): # (accel_group, window, key, modifiers):
 
236
    def _search_by_text(self, accel_group, window, key, modifiers):
243
237
        self._search.show_for('text')
244
238
        self._search.set_target(self.annoview, TEXT_LINE_COL)
245
239
 
246
 
    def _search_by_line(self, *ignored): # accel_group, window, key, modifiers):
 
240
    def _search_by_line(self, accel_group, window, key, modifiers):
247
241
        self._search.show_for('line')
248
242
        self._search.set_target(self.annoview, LINE_NUM_COL)
249
243
 
250
244
    def line_diff(self, tv, path, tvc):
251
 
        row = path.get_indices()[0]
 
245
        row = path[0]
252
246
        revision = self.annotations[row]
253
247
        repository = self.branch.repository
254
248
        if revision.revision_id == CURRENT_REVISION:
261
255
            else:
262
256
                tree2 = repository.revision_tree(NULL_REVISION)
263
257
        from bzrlib.plugins.gtk.diff import DiffWindow
264
 
        window = DiffWindow(self)
 
258
        window = DiffWindow()
265
259
        window.set_diff("Diff for line %d" % (row+1), tree1, tree2)
266
260
        window.set_file(tree1.id2path(self.file_id))
267
261
        window.show()
268
262
 
269
263
 
270
264
    def _create_annotate_view(self):
271
 
        tv = Gtk.TreeView()
 
265
        tv = gtk.TreeView()
272
266
        tv.set_rules_hint(False)
273
267
        tv.connect("cursor-changed", self._activate_selected_revision)
274
268
        tv.show()
275
269
        tv.connect("row-activated", self.line_diff)
276
270
 
277
 
        cell = Gtk.CellRendererText()
 
271
        cell = gtk.CellRendererText()
278
272
        cell.set_property("xalign", 1.0)
279
273
        cell.set_property("ypad", 0)
280
274
        cell.set_property("family", "Monospace")
281
275
        cell.set_property("cell-background-gdk",
282
 
                          tv.get_style().bg[Gtk.StateType.NORMAL])
283
 
        col = Gtk.TreeViewColumn()
 
276
                          tv.get_style().bg[gtk.STATE_NORMAL])
 
277
        col = gtk.TreeViewColumn()
284
278
        col.set_resizable(False)
285
 
        col.pack_start(cell, True)
 
279
        col.pack_start(cell, expand=True)
286
280
        col.add_attribute(cell, "text", LINE_NUM_COL)
287
281
        tv.append_column(col)
288
282
 
289
 
        cell = Gtk.CellRendererText()
 
283
        cell = gtk.CellRendererText()
290
284
        cell.set_property("ypad", 0)
291
 
        cell.set_property("ellipsize", Pango.EllipsizeMode.END)
 
285
        cell.set_property("ellipsize", pango.ELLIPSIZE_END)
292
286
        cell.set_property("cell-background-gdk",
293
 
                          self.get_style().bg[Gtk.StateType.NORMAL])
294
 
        col = Gtk.TreeViewColumn("Committer")
 
287
                          self.get_style().bg[gtk.STATE_NORMAL])
 
288
        col = gtk.TreeViewColumn("Committer")
295
289
        col.set_resizable(True)
296
 
        col.pack_start(cell, True)
 
290
        col.pack_start(cell, expand=True)
297
291
        col.add_attribute(cell, "text", COMMITTER_COL)
298
292
        tv.append_column(col)
299
293
 
300
 
        cell = Gtk.CellRendererText()
 
294
        cell = gtk.CellRendererText()
301
295
        cell.set_property("xalign", 1.0)
302
296
        cell.set_property("ypad", 0)
303
297
        cell.set_property("cell-background-gdk",
304
 
                          self.get_style().bg[Gtk.StateType.NORMAL])
305
 
        col = Gtk.TreeViewColumn("Revno")
 
298
                          self.get_style().bg[gtk.STATE_NORMAL])
 
299
        col = gtk.TreeViewColumn("Revno")
306
300
        col.set_resizable(False)
307
 
        col.pack_start(cell, True)
 
301
        col.pack_start(cell, expand=True)
308
302
        col.add_attribute(cell, "markup", REVNO_COL)
309
303
        tv.append_column(col)
310
304
 
311
 
        cell = Gtk.CellRendererText()
 
305
        cell = gtk.CellRendererText()
312
306
        cell.set_property("ypad", 0)
313
307
        cell.set_property("family", "Monospace")
314
 
        col = Gtk.TreeViewColumn()
 
308
        col = gtk.TreeViewColumn()
315
309
        col.set_resizable(False)
316
 
        col.pack_start(cell, True)
 
310
        col.pack_start(cell, expand=True)
317
311
#        col.add_attribute(cell, "foreground", HIGHLIGHT_COLOR_COL)
318
312
        col.add_attribute(cell, "background", HIGHLIGHT_COLOR_COL)
319
313
        col.add_attribute(cell, "text", TEXT_LINE_COL)
320
314
        tv.append_column(col)
321
315
 
322
 
        # interactive substring search
323
 
        def search_equal_func(model, column, key, iter):
324
 
            return model.get_value(iter, TEXT_LINE_COL).lower().find(key.lower()) == -1
325
 
 
326
 
        tv.set_enable_search(True)
327
 
        tv.set_search_equal_func(search_equal_func, None)
 
316
        # FIXME: Now that C-f is now used for search by text we
 
317
        # may as well disable the auto search.
 
318
        tv.set_search_column(LINE_NUM_COL)
328
319
 
329
320
        return tv
330
321
 
331
322
    def _create_log_view(self):
332
 
        lv = RevisionView(self._branch)
 
323
        lv = RevisionView()
333
324
        lv.show()
334
325
        return lv
335
326
 
336
327
    def _create_back_button(self):
337
 
        button = Gtk.Button()
 
328
        button = gtk.Button()
338
329
        button.set_use_stock(True)
339
330
        button.set_label("gtk-go-back")
340
331
        button.connect("clicked", lambda w: self.go_back())
341
 
        button.set_relief(Gtk.ReliefStyle.NONE)
 
332
        button.set_relief(gtk.RELIEF_NONE)
342
333
        button.show()
343
334
        return button
344
335
 
345
336
    def _create_forward_button(self):
346
 
        button = Gtk.Button()
 
337
        button = gtk.Button()
347
338
        button.set_use_stock(True)
348
339
        button.set_label("gtk-go-forward")
349
340
        button.connect("clicked", lambda w: self.go_forward())
350
 
        button.set_relief(Gtk.ReliefStyle.NONE)
 
341
        button.set_relief(gtk.RELIEF_NONE)
351
342
        button.show()
352
343
        button.set_sensitive(False)
353
344
        return button
354
345
 
355
 
    def _create_find_button(self):
356
 
        button = Gtk.Button()
357
 
        button.set_use_stock(True)
358
 
        button.set_label("gtk-find")
359
 
        button.set_tooltip_text("Search for text (Ctrl+F)")
360
 
        button.connect("clicked", self._search_by_text)
361
 
        button.set_relief(Gtk.ReliefStyle.NONE)
362
 
        button.show()
363
 
        button.set_sensitive(True)
364
 
        return button
365
 
 
366
 
    def _create_goto_button(self):
367
 
        button = Gtk.Button()
368
 
        button.set_label("Goto Line")
369
 
        button.set_tooltip_text("Scroll to a line by entering its number (Ctrl+G)")
370
 
        button.connect("clicked", self._search_by_line)
371
 
        button.set_relief(Gtk.ReliefStyle.NONE)
372
 
        button.show()
373
 
        button.set_sensitive(True)
374
 
        return button
375
 
 
376
346
    def go_back(self):
377
347
        last_tree = self.tree
378
348
        rev_id = self._selected_revision()
397
367
        rev_id = self._selected_revision()
398
368
        if self.file_id in target_tree:
399
369
            offset = self.get_scroll_offset(target_tree)
400
 
            path, col = self.annoview.get_cursor()
401
 
            (row,) = path.get_indices()
 
370
            (row,), col = self.annoview.get_cursor()
402
371
            self.annotate(target_tree, self.branch, self.file_id)
403
372
            new_row = row+offset
404
373
            if new_row < 0:
405
374
                new_row = 0
406
 
            new_path = Gtk.TreePath(path=new_row)
407
 
            self.annoview.set_cursor(new_path, None, False)
 
375
            self.annoview.set_cursor(new_row)
408
376
            return True
409
377
        else:
410
378
            return False
412
380
    def get_scroll_offset(self, tree):
413
381
        old = self.tree.get_file(self.file_id)
414
382
        new = tree.get_file(self.file_id)
415
 
        path, col = self.annoview.get_cursor()
416
 
        (row,) = path.get_indices()
 
383
        (row,), col = self.annoview.get_cursor()
417
384
        matcher = patiencediff.PatienceSequenceMatcher(None, old.readlines(),
418
385
                                                       new.readlines())
419
386
        for i, j, n in matcher.get_matching_blocks():
421
388
                return j - i
422
389
 
423
390
 
424
 
class FakeRevision(object):
 
391
class FakeRevision:
425
392
    """ A fake revision.
426
393
 
427
394
    For when a revision is referenced but not present.
436
403
        self.timezone = 0
437
404
        self.properties = {}
438
405
 
439
 
    def get_apparent_authors(self):
440
 
        return [self.committer]
 
406
    def get_apparent_author(self):
 
407
        return self.committer
441
408
 
442
409
 
443
410
class RevisionCache(object):
444
411
    """A caching revision source"""
445
 
 
446
412
    def __init__(self, real_source, seed_cache=None):
447
413
        self.__real_source = real_source
448
414
        if seed_cache is None:
456
422
            self.__cache[revision_id] = revision
457
423
        return self.__cache[revision_id]
458
424
 
459
 
 
460
 
class SearchBox(Gtk.HBox):
 
425
class SearchBox(gtk.HBox):
461
426
    """A button box for searching in text or lines of annotations"""
462
427
    def __init__(self):
463
 
        super(SearchBox, self).__init__(homogeneous=False, spacing=6)
 
428
        gtk.HBox.__init__(self, False, 6)
464
429
 
465
430
        # Close button
466
 
        button = Gtk.Button()
467
 
        image = Gtk.Image()
468
 
        image.set_from_stock('gtk-stop', Gtk.IconSize.BUTTON)
 
431
        button = gtk.Button()
 
432
        image = gtk.Image()
 
433
        image.set_from_stock('gtk-stop', gtk.ICON_SIZE_BUTTON)
469
434
        button.set_image(image)
470
 
        button.set_relief(Gtk.ReliefStyle.NONE)
471
 
        button.connect("clicked", lambda w: self.hide())
472
 
        self.pack_start(button, False, False, 0)
 
435
        button.set_relief(gtk.RELIEF_NONE)
 
436
        button.connect("clicked", lambda w: self.hide_all())
 
437
        self.pack_start(button, expand=False, fill=False)
473
438
 
474
439
        # Search entry
475
 
        label = Gtk.Label()
 
440
        label = gtk.Label()
476
441
        self._label = label
477
 
        self.pack_start(label, False, False, 0)
 
442
        self.pack_start(label, expand=False, fill=False)
478
443
 
479
 
        entry = Gtk.Entry()
 
444
        entry = gtk.Entry()
480
445
        self._entry = entry
481
446
        entry.connect("activate", lambda w, d: self._do_search(d),
482
447
                      'forward')
483
 
        self.pack_start(entry, False, False, 0)
 
448
        self.pack_start(entry, expand=False, fill=False)
484
449
 
485
450
        # Next/previous buttons
486
 
        button = Gtk.Button('_Next')
487
 
        image = Gtk.Image()
488
 
        image.set_from_stock('gtk-go-forward', Gtk.IconSize.BUTTON)
 
451
        button = gtk.Button('_Next')
 
452
        image = gtk.Image()
 
453
        image.set_from_stock('gtk-go-forward', gtk.ICON_SIZE_BUTTON)
489
454
        button.set_image(image)
490
455
        button.connect("clicked", lambda w, d: self._do_search(d),
491
456
                       'forward')
492
 
        self.pack_start(button, False, False, 0)
 
457
        self.pack_start(button, expand=False, fill=False)
493
458
 
494
 
        button = Gtk.Button('_Previous')
495
 
        image = Gtk.Image()
496
 
        image.set_from_stock('gtk-go-back', Gtk.IconSize.BUTTON)
 
459
        button = gtk.Button('_Previous')
 
460
        image = gtk.Image()
 
461
        image.set_from_stock('gtk-go-back', gtk.ICON_SIZE_BUTTON)
497
462
        button.set_image(image)
498
463
        button.connect("clicked", lambda w, d: self._do_search(d),
499
464
                       'backward')
500
 
        self.pack_start(button, False, False, 0)
 
465
        self.pack_start(button, expand=False, fill=False)
501
466
 
502
467
        # Search options
503
 
        check = Gtk.CheckButton('Match case')
 
468
        check = gtk.CheckButton('Match case')
504
469
        self._match_case = check
505
 
        self.pack_start(check, False, False, 0)
 
470
        self.pack_start(check, expand=False, fill=False)
506
471
 
507
 
        check = Gtk.CheckButton('Regexp')
 
472
        check = gtk.CheckButton('Regexp')
508
473
        check.connect("toggled", lambda w: self._set_label())
509
474
        self._regexp = check
510
 
        self.pack_start(check, False, False, 0)
 
475
        self.pack_start(check, expand=False, fill=False)
511
476
 
512
477
        self._view = None
513
478
        self._column = None
540
505
 
541
506
    def _match(self, model, iterator, column):
542
507
        matching_case = self._match_case.get_active()
543
 
        cell_value, = model.get(iterator, column)
 
508
        string, = model.get(iterator, column)
544
509
        key = self._entry.get_text()
545
 
        if column == LINE_NUM_COL:
546
 
            # FIXME: For goto-line there are faster algorithms than searching 
547
 
            # every line til we find the right one! -- mbp 2011-01-27
548
 
            return key.strip() == str(cell_value)
549
 
        elif self._regexp.get_active():
 
510
        if self._regexp.get_active():
550
511
            if matching_case:
551
 
                match = re.compile(key).search(cell_value, 1)
 
512
                match = re.compile(key).search(string, 1)
552
513
            else:
553
 
                match = re.compile(key, re.I).search(cell_value, 1)
 
514
                match = re.compile(key, re.I).search(string, 1)
554
515
        else:
555
516
            if not matching_case:
556
 
                cell_value = cell_value.lower()
 
517
                string = string.lower()
557
518
                key = key.lower()
558
 
            match = cell_value.find(key) != -1
 
519
            match = string.find(key) != -1
559
520
 
560
521
        return match
561
522
 
593
554
        for row in iterate(model, start):
594
555
            if self._match(model, row, self._column):
595
556
                path = model.get_path(row)
596
 
                self._view.set_cursor(path, None, False)
 
557
                self._view.set_cursor(path)
597
558
                self._view.scroll_to_cell(path, use_align=True)
598
559
                break