diff --git a/toys/pending/vi.c b/toys/pending/vi.c index d39e66eef88296cf3be0dacb1b6a5b4c5d1d383d..afedc8f872866d53dd97e0b69c0886932b43587c 100644 --- a/toys/pending/vi.c +++ b/toys/pending/vi.c @@ -877,6 +877,7 @@ void vi_main(void) int utf8_dec_p = 0; char vi_buf[16]; int vi_buf_pos = 0; + int visual_flag = 0; il = xzalloc(sizeof(struct str_line)); il->str_data = xzalloc(80); il->alloc_len = 80; @@ -908,7 +909,10 @@ void vi_main(void) int key = scan_key(keybuf, -1); terminal_size(&TT.screen_width, &TT.screen_height); - TT.screen_height -= 2; //TODO this is hack fix visual alignment + if (visual_flag == 0) { + TT.screen_height -= 2; + visual_flag++; + } // TODO: support cursor keys in ex mode too. if (TT.vi_mode && key>=256) { key -= 256;