aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-06-11 13:53:26 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2012-06-11 13:53:26 +0200
commitd3dff879f0683c2a4119f694c1b20c96ee030a26 (patch)
tree5c09c593a0c5ee214c78b36208c23d7a03750a68
parent04b52892ed5d9d8a4cf5d887c221a8b50c71274e (diff)
downloadbusybox-w32-d3dff879f0683c2a4119f694c1b20c96ee030a26.tar.gz
busybox-w32-d3dff879f0683c2a4119f694c1b20c96ee030a26.tar.bz2
busybox-w32-d3dff879f0683c2a4119f694c1b20c96ee030a26.zip
vi: save/restore screen upon invocation
function old new delta vi_main 253 273 +20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/vi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 459f374f7..e09e0d9c7 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -598,11 +598,15 @@ int vi_main(int argc, char **argv)
598 //----- This is the main file handling loop -------------- 598 //----- This is the main file handling loop --------------
599 save_argc = argc; 599 save_argc = argc;
600 optind = 0; 600 optind = 0;
601 // "Save cursor, use alternate screen buffer, clear screen"
602 write1("\033[?1049h");
601 while (1) { 603 while (1) {
602 edit_file(argv[optind]); /* param might be NULL */ 604 edit_file(argv[optind]); /* param might be NULL */
603 if (++optind >= argc) 605 if (++optind >= argc)
604 break; 606 break;
605 } 607 }
608 // "Use normal screen buffer, restore cursor"
609 write1("\033[?1049l");
606 //----------------------------------------------------------- 610 //-----------------------------------------------------------
607 611
608 return 0; 612 return 0;