Archived
1
0
Fork 0

More cursor control

This commit is contained in:
Braiden Vasco 2017-07-21 13:21:43 +00:00
parent e1c4342dd4
commit 253aeab321

View file

@ -81,6 +81,10 @@ private
case event case event
when /[a-zA-Z0-9 _-]/ when /[a-zA-Z0-9 _-]/
@search.putc event @search.putc event
when Curses::Key::LEFT
@search.left
when Curses::Key::RIGHT
@search.right
when Curses::Key::HOME when Curses::Key::HOME
@search.home @search.home
when Curses::Key.const_get(:END) when Curses::Key.const_get(:END)
@ -139,6 +143,16 @@ class Search
update update
end end
def left
@cursor_pos -= 1
update
end
def right
@cursor_pos += 1
update
end
def home def home
@cursor_pos = 0 @cursor_pos = 0
end end