mirror of
https://github.com/janet-lang/janet
synced 2025-10-21 18:57:41 +00:00
Add history first and history last shortcuts.
Alt-, and Alt-.
This commit is contained in:
@@ -280,10 +280,8 @@ static void historymove(int delta) {
|
||||
gbl_historyi += delta;
|
||||
if (gbl_historyi < 0) {
|
||||
gbl_historyi = 0;
|
||||
return;
|
||||
} else if (gbl_historyi >= gbl_history_count) {
|
||||
gbl_historyi = gbl_history_count - 1;
|
||||
return;
|
||||
}
|
||||
strncpy(gbl_buf, gbl_history[gbl_historyi], JANET_LINE_MAX - 1);
|
||||
gbl_pos = gbl_len = strlen(gbl_buf);
|
||||
@@ -720,6 +718,12 @@ static int line() {
|
||||
case 'f':
|
||||
krightw();
|
||||
break;
|
||||
case ',':
|
||||
historymove(JANET_HISTORY_MAX);
|
||||
break;
|
||||
case '.':
|
||||
historymove(-JANET_HISTORY_MAX);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user