mirror of
https://github.com/sheumann/hush.git
synced 2025-02-21 04:29:09 +00:00
vi: save/restore screen upon invocation
function old new delta vi_main 253 273 +20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
04b52892ed
commit
d3dff879f0
@ -598,11 +598,15 @@ int vi_main(int argc, char **argv)
|
|||||||
//----- This is the main file handling loop --------------
|
//----- This is the main file handling loop --------------
|
||||||
save_argc = argc;
|
save_argc = argc;
|
||||||
optind = 0;
|
optind = 0;
|
||||||
|
// "Save cursor, use alternate screen buffer, clear screen"
|
||||||
|
write1("\033[?1049h");
|
||||||
while (1) {
|
while (1) {
|
||||||
edit_file(argv[optind]); /* param might be NULL */
|
edit_file(argv[optind]); /* param might be NULL */
|
||||||
if (++optind >= argc)
|
if (++optind >= argc)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// "Use normal screen buffer, restore cursor"
|
||||||
|
write1("\033[?1049l");
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user