Commit ca0c25c
committed
Overhaul REPL history, introduce a flashy searcher
Since the dawn of the Julia REPL, history completion has been limited to
a readline-style interface. OhMyREPL improved the experience with fzf,
but those who yearned for a delightful history completion experience
(me) were left underwhelmed.
With this overhaul, I now find myself spending more time looking through
my history because it's just *so nice* to do so.
The new history system is organised as a standalone module in
stdlib/REPL/src/History with a clear separation of concerns:
1. History file management
2. Event-driven prompt/UI updating
3. Incremental filtering
4. UI display
5. Search coordination (prompt + display + filter)
I've attempted to pull out all the (reasonable) stops to make history
searching as fluid and snappy as possible. By memory mapping the history
file in the initial read, and optimising the parser, we can read ~2
million history items per second. Result filtering is incremental and
resumable, performed in dynamically sized batches to ensure
responsiveness. Rapid user inputs are debouced. We store a
log-structured record of previous search result, and compare search
strictness to resume from prior partial results instead of filtering the
history from scratch every time. Syncronisation between the interface
and filtering is enabled via a Channel-based event loop.
Enjoy! (I know I am)1 parent 9c265bf commit ca0c25c
File tree
11 files changed
+1902
-326
lines changed- stdlib
- REPL
- src
- History
11 files changed
+1902
-326
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments