mirror of
https://github.com/Savapitech/42sh.git
synced 2026-03-18 21:50:35 +01:00
Fix ctrl+y
This commit is contained in:
@@ -19,7 +19,7 @@ const expr_op_precedence_t *op_precedence(char *op)
|
||||
for (size_t i = 0; i < OPERATOR_PRECEDENCE_COUNT; i++)
|
||||
if (!strcmp(op, OPERATOR_PRECEDENCE[i].name))
|
||||
return OPERATOR_PRECEDENCE + i;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static
|
||||
|
||||
@@ -36,8 +36,8 @@ bool handle_key_ctrl_y(readline_helper_t *rh, exec_ctx_t *, buff_t *buff)
|
||||
paste_len = strlen(rh->ec->paste_buff);
|
||||
if (!ensure_buff_av_capacity(buff, paste_len))
|
||||
return true;
|
||||
strcpy(buff->str + paste_len, rh->ec->paste_buff);
|
||||
buff->sz += paste_len - 2;
|
||||
strcpy(buff->str + rh->cursor, rh->ec->paste_buff);
|
||||
buff->sz += paste_len;
|
||||
rh->cursor += paste_len;
|
||||
return false;
|
||||
}
|
||||
@@ -50,9 +50,8 @@ void display_reverse_search_prompt(
|
||||
dprintf(STDOUT_FILENO, "(reverse-i-search)`%s': ", search);
|
||||
if (found != -1) {
|
||||
dprintf(STDOUT_FILENO, "%s", hist[found].command);
|
||||
if (hist[found].arg != NULL) {
|
||||
if (hist[found].arg != NULL)
|
||||
dprintf(STDOUT_FILENO, " %s", hist[found].arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ ssize_t handle_keys(
|
||||
readline_helper_t *rh,
|
||||
buff_t *buff,
|
||||
char const *read_buff,
|
||||
size_t len)
|
||||
size_t)
|
||||
{
|
||||
if (!rh->ec->isatty)
|
||||
return 0;
|
||||
@@ -137,7 +137,5 @@ ssize_t handle_keys(
|
||||
return strlen(KEY_HANDLERS[i].name);
|
||||
return -1;
|
||||
}
|
||||
for (size_t i = 0; i < len; i++)
|
||||
U_DEBUG("<- [%d]\n", read_buff[i]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user