Add ctrl+h

This commit is contained in:
savalet
2025-05-23 17:22:04 +02:00
parent d800631a07
commit 7be1b9e391
3 changed files with 7 additions and 1 deletions

View File

@@ -127,3 +127,8 @@ bool handle_key_ctrl_r(readline_helper_t *rh, exec_ctx_t *ec, buff_t *buff)
refresh_line(rh);
return false;
}
bool handle_key_ctrl_h(readline_helper_t *rh, exec_ctx_t *ec, buff_t *buff)
{
return handle_backspace(rh, ec, buff);
}

View File

@@ -29,6 +29,7 @@ bool handle_key_ctrl_k(readline_helper_t *rh, exec_ctx_t *, buff_t *buff);
bool handle_key_ctrl_w(readline_helper_t *rh, exec_ctx_t *, buff_t *buff);
bool handle_key_ctrl_y(readline_helper_t *rh, exec_ctx_t *, buff_t *buff);
bool handle_key_ctrl_r(readline_helper_t *rh, exec_ctx_t *ec, buff_t *buff);
bool handle_key_ctrl_h(readline_helper_t *rh, exec_ctx_t *ec, buff_t *buff);
bool handle_backspace(readline_helper_t *rh, exec_ctx_t *ec, buff_t *buff);
bool handle_delete(readline_helper_t *rh, exec_ctx_t *, buff_t *buff);
bool handle_key_tab(readline_helper_t *rh, exec_ctx_t *ec, buff_t *buff);

View File

@@ -12,7 +12,6 @@
#include "ast.h"
#include "common.h"
#include "debug.h"
#include "git.h"
#include "repl.h"
#include "repl/key_handler.h"
@@ -31,6 +30,7 @@ const key_handler_t KEY_HANDLERS[] = {
{"\031", handle_key_ctrl_y}, // ^Y
{"\022", handle_key_ctrl_r}, // ^R
{"\013", handle_key_ctrl_k}, // ^K
{"\010", handle_key_ctrl_h}, // ^H
{ESC "[A", handle_key_arrow_up},
{ESC "[B", handle_key_arrow_down},
{ESC "[C", handle_key_arrow_right},