Mercurial > vim
diff 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 |
line wrap: on
line diff
--- a/src/fileio.c +++ b/src/fileio.c @@ -1245,30 +1245,29 @@ 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) { - // 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; - eof = TRUE; - break; - } + 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; + eof = TRUE; + break; + } + } } }