window: disable readline default autocompletion
This commit is contained in:
@@ -18,7 +18,6 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <cassert>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@@ -83,7 +82,6 @@ void display_string()
|
|||||||
rl_line_buffer[rl_point] = pt;
|
rl_line_buffer[rl_point] = pt;
|
||||||
|
|
||||||
int pos = wcswidth(pre_pos, rl_point);
|
int pos = wcswidth(pre_pos, rl_point);
|
||||||
assert(pos >= 0);
|
|
||||||
if (pos < 0)
|
if (pos < 0)
|
||||||
pos = rl_point;
|
pos = rl_point;
|
||||||
|
|
||||||
@@ -175,6 +173,8 @@ void initScreen(GNUC_UNUSED const char *window_title, bool enable_colors)
|
|||||||
curs_set(0);
|
curs_set(0);
|
||||||
|
|
||||||
rl_initialize();
|
rl_initialize();
|
||||||
|
// disable autocompletion
|
||||||
|
rl_bind_key('\t', nullptr);
|
||||||
// overwrite readline callbacks
|
// overwrite readline callbacks
|
||||||
rl_getc_function = rl::read_key;
|
rl_getc_function = rl::read_key;
|
||||||
rl_redisplay_function = rl::display_string;
|
rl_redisplay_function = rl::display_string;
|
||||||
|
|||||||
Reference in New Issue
Block a user