}
case CMDLINE_KEY_RETURN:
- case CMDLINE_KEY_RETURN2:
+ case CMDLINE_KEY_RETURN2: {
+ char tmp;
+ while (!CIRBUF_IS_EMPTY(&rdl->right) &&
+ (tmp = cirbuf_get_head(&rdl->right))) {
+ cirbuf_del_head(&rdl->right);
+ cirbuf_add_tail(&rdl->left, tmp);
+ }
cirbuf_align_left(&rdl->left);
rdl->left_buf[CIRBUF_GET_LEN(&rdl->left)] = '\n';
rdl->left_buf[CIRBUF_GET_LEN(&rdl->left) + 1] = '\0';
return RDLINE_RES_EXITED;
#endif
return RDLINE_RES_VALIDATED;
-
+ }
#ifndef NO_RDLINE_HISTORY
case CMDLINE_KEY_UP_ARR:
case CMDLINE_KEY_CTRL_P: