3 from EditWindow
import Minibuffer
5 class Goto(Minibuffer
):
6 "A minibuffer used to find a line by number."
8 def setup(self
, window
):
10 self
.window
.set_mini_label('Goto line:')
12 info
= 'Enter the line number to go to. Line numbers start from 1. ' \
13 'Press Escape to cancel, or Return to jump to the line.'
16 line
= self
.window
.mini_entry
.get_text()
22 rox
.alert('Invalid line number: %s' % line
)
24 buffer = self
.window
.buffer
25 iter = buffer.get_iter_at_line(line
- 1)
26 buffer.place_cursor(iter)
27 self
.window
.text
.scroll_to_iter(iter,
29 self
.window
.set_minibuffer(None)