tvi: update terminal dimensions with ^L - neatvi - [fork] simple vi-type editor… | |
git clone git://src.adamsgaard.dk/neatvi | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 722ca21e37945ee1f8a7fb91022425f7ea8fcf3d | |
parent afd07cde72da1f78aed6b2319b346afe81a63b0a | |
Author: Ali Gholami Rudi <[email protected]> | |
Date: Mon, 25 Apr 2016 19:34:59 +0430 | |
vi: update terminal dimensions with ^L | |
Suggested by Hamidreza Rabbanian <[email protected]>. | |
Diffstat: | |
M term.c | 4 ++-- | |
M vi.c | 2 ++ | |
2 files changed, 4 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/term.c b/term.c | |
t@@ -26,8 +26,8 @@ void term_init(void) | |
if (getenv("COLUMNS")) | |
cols = atoi(getenv("COLUMNS")); | |
if (!ioctl(0, TIOCGWINSZ, &win)) { | |
- cols = cols ? cols : win.ws_col; | |
- rows = rows ? rows : win.ws_row; | |
+ cols = win.ws_col; | |
+ rows = win.ws_row; | |
} | |
cols = cols ? cols : 80; | |
rows = rows ? rows : 25; | |
diff --git a/vi.c b/vi.c | |
t@@ -1190,6 +1190,8 @@ static void vi(void) | |
mod = 1; | |
break; | |
case TK_CTL('l'): | |
+ term_done(); | |
+ term_init(); | |
mod = 1; | |
break; | |
case 'm': |