Mercurial > vim
changeset 11721:7e8a467acd6e v8.0.0743
patch 8.0.0743: the 'termsize' option can be set to an invalid value
commit https://github.com/vim/vim/commit/825680f5f4ffed5d57fdb283dde5f0ad734605fc
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 22 17:04:02 2017 +0200
patch 8.0.0743: the 'termsize' option can be set to an invalid value
Problem: The 'termsize' option can be set to an invalid value.
Solution: Check the 'termsize' option to be valid.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 22 Jul 2017 17:15:04 +0200 |
parents | f129bc4378fe |
children | 68b9ac79648b |
files | src/option.c src/testdir/gen_opt_test.vim src/version.c |
diffstat | 3 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/option.c +++ b/src/option.c @@ -7479,6 +7479,19 @@ did_set_string_option( } #endif +#ifdef FEAT_TERMINAL + /* 'termsize' */ + else if (varp == &curwin->w_p_tms) + { + if (*curwin->w_p_tms != NUL) + { + p = skipdigits(curwin->w_p_tms); + if (p == curwin->w_p_tms || *p != 'x' || *skipdigits(p + 1) != NUL) + errmsg = e_invarg; + } + } +#endif + /* Options that are a list of flags. */ else {
--- a/src/testdir/gen_opt_test.vim +++ b/src/testdir/gen_opt_test.vim @@ -124,6 +124,7 @@ let test_values = { \ 'switchbuf': [['', 'useopen', 'split,newtab'], ['xxx']], \ 'tagcase': [['smart', 'match'], ['', 'xxx', 'smart,match']], \ 'term': [[], []], + \ 'termsize': [['', '24x80', '0x80', '32x0', '0x0'], ['xxx', '80', '8ax9', '24x80b']], \ 'toolbar': [['', 'icons', 'text'], ['xxx']], \ 'toolbariconsize': [['', 'tiny', 'huge'], ['xxx']], \ 'ttymouse': [['', 'xterm'], ['xxx']],