aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/pos.h4
1 files changed, 3 insertions, 1 deletions
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