aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Schnitzer <mail@jakobschnitzer.de>2017-03-27 19:26:41 +0200
committerJakob Schnitzer <mail@jakobschnitzer.de>2017-03-30 23:04:54 +0200
commit0273f96ef69d2a70a9c2e77b7f5da3a811bca460 (patch)
tree0decd58a2da5bdb10e58d6a348d7e983121188b6
parent1a56a032fe6060c3b4c8532c209ccfaa90fdf74e (diff)
downloadrneovim-0273f96ef69d2a70a9c2e77b7f5da3a811bca460.tar.gz
rneovim-0273f96ef69d2a70a9c2e77b7f5da3a811bca460.tar.bz2
rneovim-0273f96ef69d2a70a9c2e77b7f5da3a811bca460.zip
options: move more validation together
-rw-r--r--src/nvim/option.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index f6639d4f6a..65457dec9f 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -4095,6 +4095,14 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
if (p_ch < 1) {
errmsg = e_positive;
}
+ } else if (pp == &curbuf->b_p_ts) {
+ if (curbuf->b_p_ts <= 0) {
+ errmsg = e_positive;
+ }
+ } else if (pp == &p_tm) {
+ if (p_tm < 0) {
+ errmsg = e_positive;
+ }
}
// If validation failed, reset to old value and return.
@@ -4246,14 +4254,6 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
}
}
- if (curbuf->b_p_ts <= 0) {
- errmsg = e_positive;
- curbuf->b_p_ts = 8;
- }
- if (p_tm < 0) {
- errmsg = e_positive;
- p_tm = 0;
- }
if ((curwin->w_p_scr <= 0
|| (curwin->w_p_scr > curwin->w_height
&& curwin->w_height > 0))