aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-12-25 18:23:14 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-12-26 00:29:15 -0500
commitf6b4547598fda6b6c45477ade00716fa93b271e9 (patch)
tree4933cd4d3aa23ca7c5d16f94ef103d8d9a9b88a7
parentfd429345c9a2d889fe04356300a7ceee483ef097 (diff)
downloadrneovim-f6b4547598fda6b6c45477ade00716fa93b271e9.tar.gz
rneovim-f6b4547598fda6b6c45477ade00716fa93b271e9.tar.bz2
rneovim-f6b4547598fda6b6c45477ade00716fa93b271e9.zip
ex_cmds: fix pvs/v781
-rw-r--r--src/nvim/ex_cmds.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 6de3c6bca2..85048427b1 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -4945,17 +4945,21 @@ help_heuristic(
* If the match is more than 2 chars from the start, multiply by 200 to
* put it after matches at the start.
*/
- if (ASCII_ISALNUM(matched_string[offset]) && offset > 0
- && ASCII_ISALNUM(matched_string[offset - 1]))
+ if (offset > 0
+ && ASCII_ISALNUM(matched_string[offset])
+ && ASCII_ISALNUM(matched_string[offset - 1])) {
offset += 10000;
- else if (offset > 2)
+ } else if (offset > 2) {
offset *= 200;
- if (wrong_case)
+ }
+ if (wrong_case) {
offset += 5000;
- /* Features are less interesting than the subjects themselves, but "+"
- * alone is not a feature. */
- if (matched_string[0] == '+' && matched_string[1] != NUL)
+ }
+ // Features are less interesting than the subjects themselves, but "+"
+ // alone is not a feature.
+ if (matched_string[0] == '+' && matched_string[1] != NUL) {
offset += 100;
+ }
return (int)(100 * num_letters + STRLEN(matched_string) + offset);
}