Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TOOLS-4439] Update for TAB key handling #2

Merged
merged 5 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/el.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
/*
* Local defaults
*/
#define CUBRID_CSQL

#ifndef CUBRID_CSQL
#define KSHVI
#endif

#define VIDEFAULT
#define ANCHOR

Expand Down
4 changes: 4 additions & 0 deletions src/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ static const el_action_t el_map_vi_insert[] = {
/* 6 */ ED_NEXT_CHAR, /* ^F */
/* 7 */ ED_UNASSIGNED, /* ^G */
/* 8 */ VI_DELETE_PREV_CHAR, /* ^H */ /* BackSpace key */
#ifdef CUBRID_CSQL
/* 9 */ ED_INSERT, /* ^I */ /* Tab Key */
#else
/* 9 */ ED_UNASSIGNED, /* ^I */ /* Tab Key */
#endif
/* 10 */ ED_NEWLINE, /* ^J */
/* 11 */ ED_KILL_LINE, /* ^K */
/* 12 */ ED_CLEAR_SCREEN, /* ^L */
Expand Down
6 changes: 6 additions & 0 deletions src/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,17 @@ rl_initialize(void)

/* set default mode to "emacs"-style and read setting afterwards */
/* so this can be overridden */
#ifdef CUBRID_CSQL
el_set(e, EL_EDITOR, "vi");
#else
el_set(e, EL_EDITOR, "emacs");
#endif
if (rl_terminal_name != NULL)
el_set(e, EL_TERMINAL, rl_terminal_name);
else
el_get(e, EL_TERMINAL, &rl_terminal_name);

#ifndef CUBRID_CSQL
/*
* Word completion - this has to go AFTER rebinding keys
* to emacs-style.
Expand All @@ -339,6 +344,7 @@ rl_initialize(void)
"ReadLine compatible completion function",
_el_rl_complete);
el_set(e, EL_BIND, "^I", "rl_complete", NULL);
#endif

/*
* Send TSTP when ^Z is pressed.
Expand Down