Mercurial > vim
comparison src/option.c @ 28357:86b6432aa1d8 v8.2.4704
patch 8.2.4704: using "else" after return or break increases indent
Commit: https://github.com/vim/vim/commit/f26c16144ddb27642c09f2cf5271afd163b36306
Author: =?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>
Date: Thu Apr 7 13:26:34 2022 +0100
patch 8.2.4704: using "else" after return or break increases indent
Problem: Using "else" after return or break increases indent.
Solution: Remove "else" and reduce indent. (Goc Dundar, closes https://github.com/vim/vim/issues/10099)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 07 Apr 2022 14:30:02 +0200 |
parents | 8bc8071928ed |
children | 473cfd79bcd8 |
comparison
equal
deleted
inserted
replaced
28356:7225ec1e64cc | 28357:86b6432aa1d8 |
---|---|
4382 return NULL; | 4382 return NULL; |
4383 } | 4383 } |
4384 #endif | 4384 #endif |
4385 if (flags & P_STRING) | 4385 if (flags & P_STRING) |
4386 return set_string_option(opt_idx, string, opt_flags); | 4386 return set_string_option(opt_idx, string, opt_flags); |
4387 else | 4387 |
4388 { | 4388 varp = get_varp_scope(&(options[opt_idx]), opt_flags); |
4389 varp = get_varp_scope(&(options[opt_idx]), opt_flags); | 4389 if (varp != NULL) // hidden option is not changed |
4390 if (varp != NULL) // hidden option is not changed | 4390 { |
4391 { | 4391 if (number == 0 && string != NULL) |
4392 if (number == 0 && string != NULL) | 4392 { |
4393 int idx; | |
4394 | |
4395 // Either we are given a string or we are setting option | |
4396 // to zero. | |
4397 for (idx = 0; string[idx] == '0'; ++idx) | |
4398 ; | |
4399 if (string[idx] != NUL || idx == 0) | |
4393 { | 4400 { |
4394 int idx; | 4401 // There's another character after zeros or the string |
4395 | 4402 // is empty. In both cases, we are trying to set a |
4396 // Either we are given a string or we are setting option | 4403 // num option using a string. |
4397 // to zero. | 4404 semsg(_(e_number_required_after_str_equal_str), |
4398 for (idx = 0; string[idx] == '0'; ++idx) | 4405 name, string); |
4399 ; | 4406 return NULL; // do nothing as we hit an error |
4400 if (string[idx] != NUL || idx == 0) | 4407 |
4401 { | |
4402 // There's another character after zeros or the string | |
4403 // is empty. In both cases, we are trying to set a | |
4404 // num option using a string. | |
4405 semsg(_(e_number_required_after_str_equal_str), | |
4406 name, string); | |
4407 return NULL; // do nothing as we hit an error | |
4408 | |
4409 } | |
4410 } | 4408 } |
4411 if (flags & P_NUM) | 4409 } |
4412 return set_num_option(opt_idx, varp, number, | 4410 if (flags & P_NUM) |
4413 NULL, 0, opt_flags); | 4411 return set_num_option(opt_idx, varp, number, |
4414 else | 4412 NULL, 0, opt_flags); |
4415 return set_bool_option(opt_idx, varp, (int)number, | 4413 else |
4416 opt_flags); | 4414 return set_bool_option(opt_idx, varp, (int)number, opt_flags); |
4417 } | 4415 } |
4418 } | 4416 |
4419 } | 4417 } |
4420 return NULL; | 4418 return NULL; |
4421 } | 4419 } |
4422 | 4420 |
4423 /* | 4421 /* |