aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2018-06-03 19:31:37 -0400
committerJustin M. Keyes <justinkz@gmail.com>2018-06-04 01:31:37 +0200
commit7795829767818a3c6cbeed7957a1ad5c03d48d41 (patch)
tree9c79b6783dc90c93c5db95f6f9b03e48898a1e43 /src/nvim/option.c
parent807a16dbc1c6acdf573f6601cb3e6e15843800d6 (diff)
downloadrneovim-7795829767818a3c6cbeed7957a1ad5c03d48d41.tar.gz
rneovim-7795829767818a3c6cbeed7957a1ad5c03d48d41.tar.bz2
rneovim-7795829767818a3c6cbeed7957a1ad5c03d48d41.zip
vim-patch:8.0.1237: ":set scroll&" often gives an error (#8473)
Problem: ":set scroll&" often gives an error. Solution: Don't use a fixed default value, use half the window height. Add a test. (Ozaki Kiichi, closes vim/vim#2104) https://github.com/vim/vim/commit/af2d20c6285c1d2973e3d9b5e8f727e3ed180493
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 88c458b597..26fc164c6c 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -939,11 +939,8 @@ void set_init_2(bool headless)
{
int idx;
- /*
- * 'scroll' defaults to half the window height. Note that this default is
- * wrong when the window height changes.
- */
- set_number_default("scroll", Rows / 2);
+ // 'scroll' defaults to half the window height. The stored default is zero,
+ // which results in the actual value computed from the window height.
idx = findoption("scroll");
if (idx >= 0 && !(options[idx].flags & P_WAS_SET)) {
set_option_default(idx, OPT_LOCAL, p_cp);