Refactored some code into a get_char method.
This commit is contained in:
parent
6a6bf0c57a
commit
41154f037e
2 changed files with 8 additions and 5 deletions
|
@ -87,11 +87,7 @@ module Diakonos
|
|||
end
|
||||
|
||||
def go_to_char( char = nil )
|
||||
if char.nil?
|
||||
set_iline "Type character to go to..."
|
||||
char = @win_main.getch
|
||||
set_iline
|
||||
end
|
||||
char ||= get_char( "Type character to go to..." )
|
||||
|
||||
if char
|
||||
moved = @current_buffer.go_to_char( char )
|
||||
|
|
|
@ -136,5 +136,12 @@ module Diakonos
|
|||
retval
|
||||
end
|
||||
|
||||
def get_char( prompt )
|
||||
set_iline prompt
|
||||
char = @win_main.getch
|
||||
set_iline
|
||||
char
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue