From 72e3d2c9baabfbcf3f6505097754472c0e88b317 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 12 Feb 2022 21:33:09 +0000 Subject: [PATCH] vim-patch:8.2.4363: MS-Windows: running out of memory for a very long line Problem: MS-Windows: running out of memory for a very long line. Solution: Use a 32 bit value for MAXCOL also when ints are 64 bits. https://github.com/vim/vim/commit/8e38555ece7d3fe1edc6681ec70fe5586a524862 This still fails Vim's Windows CI, so let's see what happens... --- src/nvim/pos.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nvim/pos.h b/src/nvim/pos.h index d17e27906e..51991ed314 100644 --- a/src/nvim/pos.h +++ b/src/nvim/pos.h @@ -16,7 +16,9 @@ typedef int colnr_T; /// Maximal (invalid) line number enum { MAXLNUM = 0x7fffffff, }; /// Maximal column number -enum { MAXCOL = INT_MAX, }; +/// MAXCOL used to be INT_MAX, but with 64 bit ints that results in running +/// out of memory when trying to allocate a very long line. +enum { MAXCOL = 0x7fffffff, }; // Minimum line number enum { MINLNUM = 1, }; // minimum column number