summaryrefslogtreecommitdiff
path: root/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/draw.c b/draw.c
index 9724a1f..3c98534 100644
--- a/draw.c
+++ b/draw.c
@@ -299,9 +299,15 @@ void visual_box(FILE *fc){
draw_box(x,y,NOFIX);
while((c=fgetc(fc))!=EOF && c != 27 && c!= 'v' && c != '\n'){
if (!move_around(c, fc)) switch(c){
+ case 'y': /* yank (copy) */
+ yank_region(MIN(orig_x,x), MIN(orig_y,y), MAX(orig_x, x), MAX(orig_y, y));
+ goto vis_exit;
+ break;
case 'f':/* fill */
f = get_key(fc, "fill char: "); /** FALLTHROUGH **/
case 'x':/* erase */
+ if (c == 'x')
+ yank_region(MIN(orig_x,x), MIN(orig_y,y), MAX(orig_x, x), MAX(orig_y, y));
erase_box(orig_x, orig_y, f);
erase_blank_lines(MIN(y,orig_y), MAX(y, orig_y));
modified = 1;
@@ -323,3 +329,8 @@ vis_exit:
redraw();
mode = MOVE;
}
+
+void paste(){
+ paste_region(x, y);
+ redraw();
+}