From 073ab7cda83ca2f804b02e10bc6be17a02c4d3c9 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sat, 16 Mar 2019 15:34:16 +0100 Subject: api: refactor FloatRelative usage --- src/nvim/window.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nvim/window.c') diff --git a/src/nvim/window.c b/src/nvim/window.c index 7acf2a7f7e..609d8f1b4f 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -685,11 +685,11 @@ static bool parse_float_relative(String relative, FloatRelative *out) *out = (FloatRelative)0; } char *str = relative.data; - if (!STRICMP(str, "editor")) { + if (striequal(str, "editor")) { *out = kFloatRelativeEditor; - } else if (!STRICMP(str, "win")) { + } else if (striequal(str, "win")) { *out = kFloatRelativeWindow; - } else if (!STRICMP(str, "cursor")) { + } else if (striequal(str, "cursor")) { *out = kFloatRelativeCursor; } else { return false; @@ -804,7 +804,8 @@ bool parse_float_config(Dictionary config, FloatConfig *fconfig, bool reconf, } } - if (has_window && !(has_relative && fconfig->relative == kFloatRelativeWindow)) { + if (has_window && !(has_relative + && fconfig->relative == kFloatRelativeWindow)) { api_set_error(err, kErrorTypeValidation, "'win' key is only valid with relative='win'"); return false; -- cgit