diff options
author | Marco Hinz <mh.codebro+github@gmail.com> | 2019-02-04 02:53:23 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-02-04 02:53:23 +0100 |
commit | 91688b488310ae45ea5874df8729e7dfe554c0bc (patch) | |
tree | 01b240279dd6369adeb782a73902f9ecab9516e6 /test/functional/terminal/scrollback_spec.lua | |
parent | 70f6939fd4b5e0f03dc606eedae13ef28fc0f9dd (diff) | |
download | rneovim-91688b488310ae45ea5874df8729e7dfe554c0bc.tar.gz rneovim-91688b488310ae45ea5874df8729e7dfe554c0bc.tar.bz2 rneovim-91688b488310ae45ea5874df8729e7dfe554c0bc.zip |
options: set 'scrollback' to -1 by default #9563
Makes the 'scrollback' option more consistent (same default for all buffers) and future-proof.
- Default to -1 for all buffers, but treat it as an implementation detail.
- Document range of 1 - 100_000.
- New terminal buffer by default sets scrollback=10_000 if the global default is -1.
- Existing terminal buffer: On entering terminal-mode or on refresh, if the user explicitly did `:set[local] scbk=-1`, the local value goes to 100_000 (max). (This is undocumented on purpose. Users should work with explicit values in the range of 1-100_000.)
Diffstat (limited to 'test/functional/terminal/scrollback_spec.lua')
-rw-r--r-- | test/functional/terminal/scrollback_spec.lua | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua index 38c7e385cc..7c74e82d17 100644 --- a/test/functional/terminal/scrollback_spec.lua +++ b/test/functional/terminal/scrollback_spec.lua @@ -481,25 +481,10 @@ describe("'scrollback' option", function() eq(-1, curbufmeths.get_option('scrollback')) end) - it(':setlocal in a normal buffer is an error', function() - command('new') - - -- :setlocal to -1 is NOT an error. - feed_command('setlocal scrollback=-1') - eq(nil, string.match(eval("v:errmsg"), "E%d*:")) - feed('<CR>') - - -- :setlocal to anything except -1 is an error. - feed_command('setlocal scrollback=42') - feed('<CR>') - eq('E474:', string.match(eval("v:errmsg"), "E%d*:")) - eq(-1, curbufmeths.get_option('scrollback')) - end) - it(':set updates local value and global default', function() set_fake_shell() - command('set scrollback=42') -- set global and (attempt) local - eq(-1, curbufmeths.get_option('scrollback')) -- normal buffer: -1 + command('set scrollback=42') -- set global value + eq(42, curbufmeths.get_option('scrollback')) command('terminal') eq(42, curbufmeths.get_option('scrollback')) -- inherits global default command('setlocal scrollback=99') |