Avoid getting window size when in cat mode
This commit is contained in:
parent
f3cd805695
commit
1e973232df
1 changed files with 3 additions and 4 deletions
7
vip.c
7
vip.c
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue