Refactored some code into a get_char method.

This commit is contained in:
Pistos 2009-06-09 14:21:04 -04:00
parent 6a6bf0c57a
commit 41154f037e
2 changed files with 8 additions and 5 deletions

View file

@ -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 )

View file

@ -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