kill_region appears to work
This commit is contained in:
15
main.c
15
main.c
@@ -11,8 +11,10 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <stdarg.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -727,6 +729,7 @@ kill_region(void)
|
|||||||
move_cursor(ARROW_RIGHT);
|
move_cursor(ARROW_RIGHT);
|
||||||
}
|
}
|
||||||
killring_append_char('\n');
|
killring_append_char('\n');
|
||||||
|
move_cursor(ARROW_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (editor.curx != curx) {
|
while (editor.curx != curx) {
|
||||||
@@ -1353,10 +1356,10 @@ get_keypress(void)
|
|||||||
char *
|
char *
|
||||||
editor_prompt(char *prompt, void (*cb)(char *, int16_t))
|
editor_prompt(char *prompt, void (*cb)(char *, int16_t))
|
||||||
{
|
{
|
||||||
size_t bufsz = 128;
|
size_t bufsz = 128;
|
||||||
char *buf = malloc(bufsz);
|
char *buf = malloc(bufsz);
|
||||||
size_t buflen = 0;
|
size_t buflen = 0;
|
||||||
int16_t c;
|
int16_t c;
|
||||||
|
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
|
|
||||||
@@ -1398,6 +1401,8 @@ editor_prompt(char *prompt, void (*cb)(char *, int16_t))
|
|||||||
cb(buf, c);
|
cb(buf, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1700,6 +1705,7 @@ process_kcommand(int16_t c)
|
|||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
editor_set_status("undo: todo");
|
editor_set_status("undo: todo");
|
||||||
|
break;
|
||||||
case 'y':
|
case 'y':
|
||||||
killring_yank();
|
killring_yank();
|
||||||
break;
|
break;
|
||||||
@@ -1797,6 +1803,7 @@ process_escape(int16_t c)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
kill_region();
|
kill_region();
|
||||||
|
break;
|
||||||
case BACKSPACE:
|
case BACKSPACE:
|
||||||
delete_prev_word();
|
delete_prev_word();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user