Skip to content

Commit

Permalink
[TOOLS-4439] Update for TAB key handling (#2)
Browse files Browse the repository at this point in the history
Modify so that the tab key is entered as it is
  • Loading branch information
kisoo-han authored Mar 17, 2023
1 parent 91d08f2 commit 864f890
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
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

0 comments on commit 864f890

Please sign in to comment.