]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1927: patch 1916 (fixed terminal size) not optimal v9.0.1927
authorChristian Brabandt <cb@256bit.org>
Thu, 21 Sep 2023 14:55:06 +0000 (16:55 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 21 Sep 2023 14:57:42 +0000 (16:57 +0200)
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>
src/libvterm/include/vterm.h
src/libvterm/src/screen.c
src/terminal.c
src/version.c

index a3aa17a8f648cdcfa438a86be1e38ac7413ae4d2..48deebe25ea5e9c011d70e40b456adce4ab62b1b 100644 (file)
@@ -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
index 7b3322b639f29eb494a684488fcc62ae4874f4ea..fd76777c410fe90082574351572f75bd2c766ffd 100644 (file)
@@ -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])
index 991f05652be90dc1f06b0e4d298aa8c41c25a00e..71566657142303614e1931df43c90104c4723d62 100644 (file)
@@ -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;
 }
 
index ced912523c581ac0f2a46ba34b2b85de3c8d2cd5..3d663e1a1350b2b10a7db61beadf645289608bfd 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1927,
 /**/
     1926,
 /**/