Skip to content

Commit

Permalink
Merge pull request #205 from milushov/navigate-history-like-in-terminal
Browse files Browse the repository at this point in the history
Jumping between prev/next history command prompts like in terminal
  • Loading branch information
Charlie Somerville committed Sep 14, 2013
2 parents 8e5b7f9 + 2937c41 commit f9c21af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/better_errors/templates/main.erb
Original file line number Diff line number Diff line change
Expand Up @@ -892,12 +892,12 @@
REPL.prototype.onKeyDown = function(ev) {
if(ev.keyCode == 13) {
this.onEnterKey();
} else if(ev.keyCode == 38) {
// the user pressed the up arrow.
} else if(ev.keyCode == 38 || (ev.ctrlKey && ev.keyCode == 80)) {
// the user pressed the up arrow or Ctrl-P
this.onNavigateHistory(-1);
return false;
} else if(ev.keyCode == 40) {
// the user pressed the down arrow.
} else if(ev.keyCode == 40 || (ev.ctrlKey && ev.keyCode == 78)) {
// the user pressed the down arrow or Ctrl-N
this.onNavigateHistory(1);
return false;
}
Expand Down

0 comments on commit f9c21af

Please sign in to comment.