summaryrefslogtreecommitdiffstats
path: root/src/dict.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-30 22:08:34 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-30 22:08:34 +0200
commit8c6173c7d3431dd8bc2b6ffc076ef49512a7e175 (patch)
treeea731594d1036e094132f9d0816e30b9717f5405 /src/dict.c
parentb5432d8968bda70fc20ebb5e136e367d174d1c4e (diff)
patch 8.1.1949: cannot scroll a popup window to the very bottomv8.1.1949
Problem: Cannot scroll a popup window to the very bottom. Solution: Scroll to the bottom when the "firstline" property was set to -1. (closes #4577) Allow resetting min/max width/height.
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/dict.c b/src/dict.c
index b2c3fbcdee..649a7da71c 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -617,11 +617,21 @@ dict_get_string(dict_T *d, char_u *key, int save)
varnumber_T
dict_get_number(dict_T *d, char_u *key)
{
+ return dict_get_number_def(d, key, 0);
+}
+
+/*
+ * Get a number item from a dictionary.
+ * Returns "def" if the entry doesn't exist.
+ */
+ varnumber_T
+dict_get_number_def(dict_T *d, char_u *key, int def)
+{
dictitem_T *di;
di = dict_find(d, key, -1);
if (di == NULL)
- return 0;
+ return def;
return tv_get_number(&di->di_tv);
}