Skip to content

Commit 277a91d

Browse files
authored
Change ctrl-a/ctrl-e to move to start/end of line, not buffer (duckdb#18490)
This cli behaviour has been driving me crazy, but perhaps it's only me. I think that for a multi-line query, you should go to the start/end of the current line with ctrl-a/ctrl-e, not start/end of the entire multi-line buffer. If you want to go to the start/end of the buffer, the home/end keys are bound to that. It could be a personal preference of mine, or maybe I spend too much time in the cli, but I think this is more intuitive behaviour for multi-line queries as it mirrors how multi-line editing works in some other apps, e.g web browser, word processors etc.
2 parents 631b11e + 65b441c commit 277a91d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/shell/linenoise/linenoise.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,10 +1382,10 @@ int Linenoise::Edit() {
13821382
RefreshLine();
13831383
break;
13841384
case CTRL_A: /* Ctrl+a, go to the start of the line */
1385-
EditMoveHome();
1385+
EditMoveStartOfLine();
13861386
break;
13871387
case CTRL_E: /* ctrl+e, go to the end of the line */
1388-
EditMoveEnd();
1388+
EditMoveEndOfLine();
13891389
break;
13901390
case CTRL_L: /* ctrl+l, clear screen */
13911391
linenoiseClearScreen();

0 commit comments

Comments
 (0)