We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a110252 commit 87d35b7Copy full SHA for 87d35b7
4 files changed
data/ui/meldapp-ui.xml
@@ -26,6 +26,8 @@
26
<menuitem action="FindNext"/>
27
<menuitem action="FindPrevious"/>
28
<menuitem action="Replace"/>
29
+ <separator/>
30
+ <menuitem action="GoToLine"/>
31
</menu>
32
<menu action="ChangesMenu">
33
<menuitem action="PrevChange"/>
meld/filediff.py
@@ -959,6 +959,10 @@ def on_find_next_activate(self, *args):
959
def on_find_previous_activate(self, *args):
960
self.findbar.start_find_previous(self.focus_pane)
961
962
+ @with_focused_pane
963
+ def on_go_to_line_activate(self, pane, *args):
964
+ self.statusbar[pane].emit('start-go-to-line')
965
+
966
def on_scrolledwindow_size_allocate(self, scrolledwindow, allocation):
967
index = self.scrolledwindow.index(scrolledwindow)
968
if index == 0 or index == 1:
meld/meldwindow.py
@@ -82,6 +82,9 @@ def __init__(self):
82
_("_Replace…"), "<Primary>H",
83
_("Find and replace text"),
84
self.on_menu_replace_activate),
85
+ ("GoToLine", None, _("Go to _Line"), "<Primary>I",
86
+ _("Go to a specific line"),
87
+ self.on_menu_go_to_line_activate),
88
89
("ChangesMenu", None, _("_Changes")),
90
("NextChange", Gtk.STOCK_GO_DOWN, _("Next Change"), "<Alt>Down",
@@ -446,6 +449,9 @@ def on_menu_find_previous_activate(self, *extra):
446
449
def on_menu_replace_activate(self, *extra):
447
450
self.current_doc().on_replace_activate()
448
451
452
+ def on_menu_go_to_line_activate(self, *extra):
453
+ self.current_doc().on_go_to_line_activate()
454
455
def on_menu_copy_activate(self, *extra):
456
widget = self.widget.get_focus()
457
if isinstance(widget, Gtk.Editable):
meld/ui/statusbar.py
@@ -103,6 +103,8 @@ class MeldStatusBar(Gtk.Statusbar):
103
__gtype_name__ = "MeldStatusBar"
104
105
__gsignals__ = {
106
+ 'start-go-to-line': (
107
+ GObject.SignalFlags.ACTION, None, tuple()),
108
'go-to-line': (
109
GObject.SignalFlags.RUN_FIRST, None, (int,)),
110
'encoding-changed': (
@@ -205,6 +207,7 @@ def format_cursor_position(binding, cursor):
205
207
self.bind_property(
206
208
'cursor_position', button, 'label', GObject.BindingFlags.DEFAULT,
209
format_cursor_position)
210
+ self.connect('start-go-to-line', lambda *args: button.clicked())
211
button.set_popover(pop)
212
button.show()
213
0 commit comments