Commit 79b81af
committed
fix: Stop replxx aborting when navigating multi-line buffers
mgconsole assembles multi-line queries itself via the continuation prompt and
does not use replxx's in-buffer multiline editing, which is buggy in the pinned
release-0.0.4. history_previous() calls prev_newline_position(_pos - 1) without
the `_pos > 0` guard its sibling history_next() has; with a newline at buffer
position 0 (navigating up through a recalled multi-line history entry) it passes
-1 and trips an assertion that aborts the process. Separately, in-buffer
multiline redraws clear to end of screen and erase already-printed output.
Patch replxx (replxx-patches/, applied via the replxx-proj PATCH_COMMAND) to add
the missing bounds guard to history_previous. This fixes the abort for any
newline-bearing buffer, including multi-line entries decoded from the history
file.
Rebind Ctrl-J (line feed, 0x0A) to commit_line so a bare newline submits the
current line like Enter instead of feeding replxx's NEW_LINE action. A multi-line
paste then submits one physical line at a time, which is what GetQuery expects,
and keeps pasted or typed newlines out of the buffer so the redraw corruption
stays unreachable for the common paste case. It does not cover newlines that
arrive from history, which is why the bounds guard is the actual crash fix.1 parent f4a1c3b commit 79b81af
4 files changed
Lines changed: 53 additions & 0 deletions
File tree
- src/utils
- replxx-patches
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
16 | 30 | | |
17 | 31 | | |
18 | 32 | | |
| |||
Lines changed: 24 additions & 0 deletions
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1324 | 1324 | | |
1325 | 1325 | | |
1326 | 1326 | | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
1327 | 1339 | | |
1328 | 1340 | | |
1329 | 1341 | | |
| |||
0 commit comments