mirror of
https://github.com/janet-lang/janet
synced 2025-02-03 02:39:09 +00:00
Add history first and history last shortcuts.
Alt-, and Alt-.
This commit is contained in:
parent
693c6d63d4
commit
68a5667a1a
@ -19,7 +19,8 @@ All notable changes to this project will be documented in this file.
|
||||
- Add `assert`
|
||||
- Add `when-with`
|
||||
- Add `if-with`
|
||||
- Add completion to the default repl based on currently defined bindings.
|
||||
- Add completion to the default repl based on currently defined bindings. Also generally improve
|
||||
the repl keybindings.
|
||||
- Add `eachk`
|
||||
- Add `eachp`
|
||||
- Improve functionality of the `next` function. `next` now works on many different
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user