diff options
author | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
commit | 308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (patch) | |
tree | 35fe43e01755e0f312650667004487a44d6b7941 /src/nvim/pos.h | |
parent | 96a00c7c588b2f38a2424aeeb4ea3581d370bf2d (diff) | |
parent | e8c94697bcbe23a5c7b07c292b90a6b70aadfa87 (diff) | |
download | rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.gz rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.bz2 rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.zip |
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'src/nvim/pos.h')
-rw-r--r-- | src/nvim/pos.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/nvim/pos.h b/src/nvim/pos.h index d17e27906e..1b7e6273fd 100644 --- a/src/nvim/pos.h +++ b/src/nvim/pos.h @@ -1,12 +1,12 @@ #ifndef NVIM_POS_H #define NVIM_POS_H -// for INT_MAX, LONG_MAX et al. -#include <limits.h> +#include <inttypes.h> -typedef long linenr_T; // line number type +/// Line number type +typedef int32_t linenr_T; /// Format used to print values which have linenr_T type -#define PRIdLINENR "ld" +#define PRIdLINENR PRId32 /// Column number type typedef int colnr_T; @@ -15,29 +15,29 @@ typedef int colnr_T; /// Maximal (invalid) line number enum { MAXLNUM = 0x7fffffff, }; + /// Maximal column number -enum { MAXCOL = INT_MAX, }; -// Minimum line number +/// 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 + +/// Minimum column number enum { MINCOL = 1, }; -/* - * position in file or buffer - */ +/// position in file or buffer typedef struct { - linenr_T lnum; // line number - colnr_T col; // column number + linenr_T lnum; ///< line number + colnr_T col; ///< column number colnr_T coladd; } pos_T; - -/* - * Same, but without coladd. - */ +/// position in file or buffer, but without coladd typedef struct { - linenr_T lnum; // line number - colnr_T col; // column number + linenr_T lnum; ///< line number + colnr_T col; ///< column number } lpos_T; #endif // NVIM_POS_H |