summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-20 11:00:28 +0000
committerDenys Vlasenko <vda.linux@googlemail.com>2019-03-30 18:03:37 +0100
commita2fd1aaf86e2adc16101bdf95770a2783830727a (patch)
tree4e7d63d6718ce3d456ca5d8bd4171932fe793c7a
parent0f5a7f35206668f79c18415eaa4a1fd15750dc74 (diff)
downloadbusybox-w32-a2fd1aaf86e2adc16101bdf95770a2783830727a.tar.gz
busybox-w32-a2fd1aaf86e2adc16101bdf95770a2783830727a.tar.bz2
busybox-w32-a2fd1aaf86e2adc16101bdf95770a2783830727a.zip
vi: allow manual screen update if SIGWINCH isn't supported
On platforms that don't support SIGWINCH vi can be configured with FEATURE_VI_USE_SIGNALS disabled and FEATURE_VI_WIN_RESIZE enabled. This allows the user to force an update with ^L when the screen is resized. However, because the SIGWINCH handler hasn't run the virtual screen buffer won't have been updated and the display becomes corrupted. Fix this by calling new_screen() if necessary. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/vi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 5e5e13111..425d14c9c 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -3349,7 +3349,15 @@ static void refresh(int full_screen)
3349 if (ENABLE_FEATURE_VI_WIN_RESIZE IF_FEATURE_VI_ASK_TERMINAL(&& !G.get_rowcol_error) ) { 3349 if (ENABLE_FEATURE_VI_WIN_RESIZE IF_FEATURE_VI_ASK_TERMINAL(&& !G.get_rowcol_error) ) {
3350 unsigned c = columns, r = rows; 3350 unsigned c = columns, r = rows;
3351 query_screen_dimensions(); 3351 query_screen_dimensions();
3352#if ENABLE_FEATURE_VI_USE_SIGNALS
3352 full_screen |= (c - columns) | (r - rows); 3353 full_screen |= (c - columns) | (r - rows);
3354#else
3355 if (c != columns || r != rows) {
3356 full_screen = TRUE;
3357 /* update screen memory since SIGWINCH won't have done it */
3358 new_screen(rows, columns);
3359 }
3360#endif
3353 } 3361 }
3354 sync_cursor(dot, &crow, &ccol); // where cursor will be (on "dot") 3362 sync_cursor(dot, &crow, &ccol); // where cursor will be (on "dot")
3355 tp = screenbegin; // index into text[] of top line 3363 tp = screenbegin; // index into text[] of top line