patch 8.1.1452: line and col property of popup windows not properly checked
Problem: Line and col property of popup windows not properly checked.
Solution: Check for "+" or "-" sign.
diff --git a/src/dict.c b/src/dict.c
index d6b3b18..c67eb42 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -605,6 +605,27 @@
}
/*
+ * Get a number item from a dictionary.
+ * Returns 0 if the entry doesn't exist.
+ * Give an error if the entry is not a number.
+ */
+ varnumber_T
+dict_get_number_check(dict_T *d, char_u *key)
+{
+ dictitem_T *di;
+
+ di = dict_find(d, key, -1);
+ if (di == NULL)
+ return 0;
+ if (di->di_tv.v_type != VAR_NUMBER)
+ {
+ semsg(_(e_invarg2), tv_get_string(&di->di_tv));
+ return 0;
+ }
+ return tv_get_number(&di->di_tv);
+}
+
+/*
* Return an allocated string with the string representation of a Dictionary.
* May return NULL.
*/