diff options
author | Christian Brabandt <cb@256bit.org> | 2023-09-21 16:55:06 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-09-21 16:57:42 +0200 |
commit | ceee7a808ce82b0c6bd84e0b6fc1dfb0475c99aa (patch) | |
tree | c9abd729a9d2e83b78e06499ab611a4a1078f872 | |
parent | 696270bcae0c14029030f14a3f3ca2763a2b39de (diff) |
patch 9.0.1927: patch 1916 (fixed terminal size) not optimalv9.0.1927
Problem: patch 1916 (fixed terminal size) not optimal
Solution: Add defines to make it easier changeable later
Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r-- | src/libvterm/include/vterm.h | 4 | ||||
-rw-r--r-- | src/libvterm/src/screen.c | 8 | ||||
-rw-r--r-- | src/terminal.c | 8 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 14 insertions, 8 deletions
diff --git a/src/libvterm/include/vterm.h b/src/libvterm/include/vterm.h index a3aa17a8f6..48deebe25e 100644 --- a/src/libvterm/include/vterm.h +++ b/src/libvterm/include/vterm.h @@ -21,6 +21,10 @@ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; +// VIM: define max screen cols and rows +#define VTERM_MAX_COLS 1000 +#define VTERM_MAX_ROWS 1000 + #define VTERM_VERSION_MAJOR 0 #define VTERM_VERSION_MINOR 3 #define VTERM_VERSION_PATCH 3 diff --git a/src/libvterm/src/screen.c b/src/libvterm/src/screen.c index 7b3322b639..fd76777c41 100644 --- a/src/libvterm/src/screen.c +++ b/src/libvterm/src/screen.c @@ -776,14 +776,14 @@ static int resize(int new_rows, int new_cols, VTermStateFields *fields, void *us if(screen->sb_buffer) vterm_allocator_free(screen->vt, screen->sb_buffer); - if (new_cols > 1000) - new_cols = 1000; + if (new_cols > VTERM_MAX_COLS) + new_cols = VTERM_MAX_COLS; screen->sb_buffer = vterm_allocator_malloc(screen->vt, sizeof(VTermScreenCell) * new_cols); } - if (new_rows > 1000) - new_rows = 1000; + if (new_rows > VTERM_MAX_ROWS) + new_rows = VTERM_MAX_ROWS; resize_buffer(screen, 0, new_rows, new_cols, !altscreen_active, fields); if(screen->buffers[BUFIDX_ALTSCREEN]) diff --git a/src/terminal.c b/src/terminal.c index 991f05652b..7156665714 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -272,10 +272,10 @@ parse_termwinsize(win_T *wp, int *rows, int *cols) } *rows = atoi((char *)wp->w_p_tws); *cols = atoi((char *)p + 1); - if (*rows > 1000) - *rows = 1000; - if (*cols > 1000) - *cols = 1000; + if (*rows > VTERM_MAX_ROWS) + *rows = VTERM_MAX_ROWS; + if (*cols > VTERM_MAX_COLS) + *cols = VTERM_MAX_COLS; return minsize; } diff --git a/src/version.c b/src/version.c index ced912523c..3d663e1a13 100644 --- a/src/version.c +++ b/src/version.c @@ -700,6 +700,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1927, +/**/ 1926, /**/ 1925, |