aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pos.h23
-rw-r--r--src/regexp_defs.h2
-rw-r--r--src/structs.h23
3 files changed, 28 insertions, 20 deletions
diff --git a/src/pos.h b/src/pos.h
new file mode 100644
index 0000000000..df6e0e5c39
--- /dev/null
+++ b/src/pos.h
@@ -0,0 +1,23 @@
+#ifndef NEOVIM_POS_H
+#define NEOVIM_POS_H
+
+/*
+ * position in file or buffer
+ */
+typedef struct {
+ linenr_T lnum; /* line number */
+ colnr_T col; /* column number */
+ colnr_T coladd;
+} pos_T;
+
+# define INIT_POS_T(l, c, ca) {l, c, ca}
+
+/*
+ * Same, but without coladd.
+ */
+typedef struct {
+ linenr_T lnum; /* line number */
+ colnr_T col; /* column number */
+} lpos_T;
+
+#endif /* NEOVIM_POS_H */
diff --git a/src/regexp_defs.h b/src/regexp_defs.h
index 0426f242a4..e7dd39dade 100644
--- a/src/regexp_defs.h
+++ b/src/regexp_defs.h
@@ -13,6 +13,8 @@
#ifndef _REGEXP_H
#define _REGEXP_H
+#include "pos.h"
+
/*
* The number of sub-matches is limited to 10.
* The first one (index 0) is the whole match, referenced with "\0".
diff --git a/src/structs.h b/src/structs.h
index 4aba076502..e52eb1c4aa 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -8,30 +8,13 @@
// for garray_T
#include "garray.h"
+// for pos_T and lpos_T
+#include "pos.h"
/*
* This file contains various definitions of structures that are used by Vim
*/
-/*
- * position in file or buffer
- */
-typedef struct {
- linenr_T lnum; /* line number */
- colnr_T col; /* column number */
- colnr_T coladd;
-} pos_T;
-
-# define INIT_POS_T(l, c, ca) {l, c, ca}
-
-/*
- * Same, but without coladd.
- */
-typedef struct {
- linenr_T lnum; /* line number */
- colnr_T col; /* column number */
-} lpos_T;
-
typedef struct window_S win_T;
typedef struct wininfo_S wininfo_T;
typedef struct frame_S frame_T;
@@ -39,7 +22,7 @@ typedef int scid_T; /* script ID */
typedef struct file_buffer buf_T; /* forward declaration */
/*
- * This is here because regexp_defs.h needs pos_T and below regprog_T is used.
+ * This is here because regexp_defs.h needs win_T and regprog_T is used below.
*/
#include "regexp_defs.h"