aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro+github@gmail.com>2019-03-17 02:34:50 +0100
committerGitHub <noreply@github.com>2019-03-17 02:34:50 +0100
commit9ef8d0d6b0a8a607b2ee3fe3ca38395e470a2223 (patch)
tree725781c58344976db7f422a79307c1c6a834d65d /src/nvim/buffer_defs.h
parent7c38994ff2397772234bd89faf8b372fa9fecfbd (diff)
parentb557654f36c4c3c4352c838d0d8d1df3e5340655 (diff)
downloadrneovim-9ef8d0d6b0a8a607b2ee3fe3ca38395e470a2223.tar.gz
rneovim-9ef8d0d6b0a8a607b2ee3fe3ca38395e470a2223.tar.bz2
rneovim-9ef8d0d6b0a8a607b2ee3fe3ca38395e470a2223.zip
Merge pull request #9726 from mhinz/nvim_win_get_config
Closes #9723
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h41
1 files changed, 25 insertions, 16 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index d35e3b49d8..2f2546b360 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -958,24 +958,32 @@ struct matchitem {
int conceal_char; ///< cchar for Conceal highlighting
};
-typedef enum {
- kFloatAnchorEast = 1,
- kFloatAnchorSouth = 2,
-
- kFloatAnchorNW = 0,
- kFloatAnchorNE = 1,
- kFloatAnchorSW = 2,
- kFloatAnchorSE = 3,
-} FloatAnchor;
-
-typedef enum {
- kFloatRelativeEditor = 0,
- kFloatRelativeWindow = 1,
- kFloatRelativeCursor = 2,
-} FloatRelative;
+typedef int FloatAnchor;
+typedef int FloatRelative;
+
+enum {
+ kFloatAnchorEast = 1,
+ kFloatAnchorSouth = 2,
+};
+
+// NW -> 0
+// NE -> kFloatAnchorEast
+// SW -> kFloatAnchorSouth
+// SE -> kFloatAnchorSouth | kFloatAnchorEast
+EXTERN const char *const float_anchor_str[] INIT(= { "NW", "NE", "SW", "SE" });
+
+enum {
+ kFloatRelativeEditor = 0,
+ kFloatRelativeWindow = 1,
+ kFloatRelativeCursor = 2,
+};
+
+EXTERN const char *const float_relative_str[] INIT(= { "editor", "window",
+ "cursor" });
typedef struct {
Window window;
+ int height, width;
double row, col;
FloatAnchor anchor;
FloatRelative relative;
@@ -983,7 +991,8 @@ typedef struct {
bool focusable;
} FloatConfig;
-#define FLOAT_CONFIG_INIT ((FloatConfig){ .row = 0, .col = 0, .anchor = 0, \
+#define FLOAT_CONFIG_INIT ((FloatConfig){ .height = 0, .width = 0, \
+ .row = 0, .col = 0, .anchor = 0, \
.relative = 0, .external = false, \
.focusable = true })