Avoid getting window size when in cat mode

This commit is contained in:
Night Kaly 2024-11-12 11:57:27 +00:00
parent f3cd805695
commit 1e973232df
Signed by: night0721
SSH key fingerprint: SHA256:B/hgVwUoBpx5vdNsXl9w8XwZljA9766uk6T4ubZp5HM

7
vip.c
View file

@ -1015,10 +1015,6 @@ void handle_sigwinch(int ignore)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
if (get_window_size(&rows, &cols) == -1) {
die("get_window_size");
}
struct sigaction sa; struct sigaction sa;
sa.sa_handler = handle_sigwinch; sa.sa_handler = handle_sigwinch;
sa.sa_flags = SA_RESTART; sa.sa_flags = SA_RESTART;
@ -1036,6 +1032,9 @@ int main(int argc, char **argv)
if (argc > 2 && !strcmp(argv[1], "-c")) { if (argc > 2 && !strcmp(argv[1], "-c")) {
cat_mode = 1; cat_mode = 1;
} else { } else {
if (get_window_size(&rows, &cols) == -1) {
die("get_window_size");
}
bprintf("\033[?1049h\033[2J\033[2q"); bprintf("\033[?1049h\033[2J\033[2q");
newt = oldt; newt = oldt;