comparison src/fileio.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 0390c4848b27
children d770568e6c98
comparison
equal deleted inserted replaced
28356:7225ec1e64cc 28357:86b6432aa1d8
1243 ptr[tlen++] = p[ni]; 1243 ptr[tlen++] = p[ni];
1244 } 1244 }
1245 read_buf_col += n; 1245 read_buf_col += n;
1246 break; 1246 break;
1247 } 1247 }
1248 else 1248
1249 // Append whole line and new-line. Change NL
1250 // to NUL to reverse the effect done below.
1251 for (ni = 0; ni < n; ++ni)
1249 { 1252 {
1250 // Append whole line and new-line. Change NL 1253 if (p[ni] == NL)
1251 // to NUL to reverse the effect done below. 1254 ptr[tlen++] = NUL;
1252 for (ni = 0; ni < n; ++ni) 1255 else
1253 { 1256 ptr[tlen++] = p[ni];
1254 if (p[ni] == NL)
1255 ptr[tlen++] = NUL;
1256 else
1257 ptr[tlen++] = p[ni];
1258 }
1259 ptr[tlen++] = NL;
1260 read_buf_col = 0;
1261 if (++read_buf_lnum > from)
1262 {
1263 // When the last line didn't have an
1264 // end-of-line don't add it now either.
1265 if (!curbuf->b_p_eol)
1266 --tlen;
1267 size = tlen;
1268 eof = TRUE;
1269 break;
1270 }
1271 } 1257 }
1258 ptr[tlen++] = NL;
1259 read_buf_col = 0;
1260 if (++read_buf_lnum > from)
1261 {
1262 // When the last line didn't have an
1263 // end-of-line don't add it now either.
1264 if (!curbuf->b_p_eol)
1265 --tlen;
1266 size = tlen;
1267 eof = TRUE;
1268 break;
1269 }
1270
1272 } 1271 }
1273 } 1272 }
1274 } 1273 }
1275 else 1274 else
1276 { 1275 {