aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-08 10:25:22 +0800
committerGitHub <noreply@github.com>2022-04-08 10:25:22 +0800
commit356baae80ad42e8a13d650675a0e56e931f08541 (patch)
treed8df461b5059c0f43bc99b596dc59ee62a5c551f /src/nvim/fileio.c
parent4c9a71c69e60ea6dd4794d1c8ce478f5aa1b3f4d (diff)
downloadrneovim-356baae80ad42e8a13d650675a0e56e931f08541.tar.gz
rneovim-356baae80ad42e8a13d650675a0e56e931f08541.tar.bz2
rneovim-356baae80ad42e8a13d650675a0e56e931f08541.zip
vim-patch:8.2.4704: using "else" after return or break increases indent (#18032)
Problem: Using "else" after return or break increases indent. Solution: Remove "else" and reduce indent. (Goc Dundar, closes vim/vim#10099) https://github.com/vim/vim/commit/f26c16144ddb27642c09f2cf5271afd163b36306
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index d68dda15f3..d4407b4982 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -1015,27 +1015,27 @@ retry:
}
read_buf_col += n;
break;
- } else {
- // Append whole line and new-line. Change NL
- // to NUL to reverse the effect done below.
- for (ni = 0; ni < n; ni++) {
- if (p[ni] == NL) {
- ptr[tlen++] = NUL;
- } else {
- ptr[tlen++] = p[ni];
- }
+ }
+
+ // Append whole line and new-line. Change NL
+ // to NUL to reverse the effect done below.
+ for (ni = 0; ni < n; ni++) {
+ if (p[ni] == NL) {
+ ptr[tlen++] = NUL;
+ } else {
+ ptr[tlen++] = p[ni];
}
- ptr[tlen++] = NL;
- read_buf_col = 0;
- if (++read_buf_lnum > from) {
- // When the last line didn't have an
- // end-of-line don't add it now either.
- if (!curbuf->b_p_eol) {
- --tlen;
- }
- size = tlen;
- break;
+ }
+ ptr[tlen++] = NL;
+ read_buf_col = 0;
+ if (++read_buf_lnum > from) {
+ // When the last line didn't have an
+ // end-of-line don't add it now either.
+ if (!curbuf->b_p_eol) {
+ tlen--;
}
+ size = tlen;
+ break;
}
}
}