Skip to content

Commit

Permalink
Support Home and End key to move to beg and end
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed May 31, 2019
1 parent 21a4348 commit 88770c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/reline.rb
Expand Up @@ -333,7 +333,9 @@ def inner_readline(prompt, add_hist, multiline, &confirm_multiline_termination)
[224, 80] => :ed_next_history, # ↓
[224, 77] => :ed_next_char, # →
[224, 75] => :ed_prev_char, # ←
[224, 83] => :key_delete # Del
[224, 83] => :key_delete, # Del
[224, 71] => :ed_move_to_beg, # Home
[224, 79] => :ed_move_to_end # End
}
}
else
Expand All @@ -343,7 +345,9 @@ def inner_readline(prompt, add_hist, multiline, &confirm_multiline_termination)
[27, 91, 66] => :ed_next_history, # ↓
[27, 91, 67] => :ed_next_char, # →
[27, 91, 68] => :ed_prev_char, # ←
[27, 91, 51, 126] => :key_delete # Del
[27, 91, 51, 126] => :key_delete, # Del
[27, 91, 49, 126] => :ed_move_to_beg,# Home
[27, 91, 52, 126] => :ed_move_to_end # End
}
}
end
Expand Down

0 comments on commit 88770c2

Please sign in to comment.