diff src/dict.c @ 17905:fb773f73a4be v8.1.1949

patch 8.1.1949: cannot scroll a popup window to the very bottom Commit: https://github.com/vim/vim/commit/8c6173c7d3431dd8bc2b6ffc076ef49512a7e175 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 30 22:08:34 2019 +0200 patch 8.1.1949: cannot scroll a popup window to the very bottom 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.
author Bram Moolenaar <Bram@vim.org>
date Fri, 30 Aug 2019 22:15:04 +0200
parents 0f7ae8010787
children 2ec4ed3f5e12
line wrap: on
line diff
--- a/src/dict.c
+++ b/src/dict.c
@@ -617,11 +617,21 @@ dict_get_string(dict_T *d, char_u *key, 
     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);
 }