diff options
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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(); +} |