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