diff --git a/runtime/ftplugin/sieve.vim b/runtime/ftplugin/sieve.vim index 8161fe99ac..1ea8eaeb9d 100644 --- a/runtime/ftplugin/sieve.vim +++ b/runtime/ftplugin/sieve.vim @@ -3,6 +3,7 @@ " Maintainer: This runtime file is looking for a new maintainer. " Previous Maintainer: Nikolai Weibull " Latest Revision: 2025 Feb 20 +" 2026 Jan 09 by Vim Project: preserve line endings for existing files #19144 if exists("b:did_ftplugin") finish @@ -16,4 +17,7 @@ setlocal formatoptions-=t formatoptions+=croql " https://datatracker.ietf.org/doc/html/rfc5228#section-2.2 says " "newlines (CRLF, never just CR or LF)" -setlocal fileformat=dos +" Use CRLF for new files only; preserve existing line endings +if expand('%:p') !=# '' && !filereadable(expand('%:p')) + setlocal fileformat=dos +endif diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index f7c2d72718..5e4848f365 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -179,10 +179,10 @@ assign_commit_details() { local vim_coauthor0 vim_coauthor0="$(git -C "${VIM_SOURCE_DIR}" log -1 --pretty='format:Co-authored-by: %an <%ae>' "${vim_commit}")" # Extract co-authors from the commit message. - vim_coauthors="$(echo "${vim_message}" | (grep -E '^Co-authored-by: ' || true) | (grep -Fxv "${vim_coauthor0}" || true))" + vim_coauthors="$(echo "${vim_message}" | (grep -E '^Co-[Aa]uthored-[Bb]y: ' || true) | (grep -Fxv "${vim_coauthor0}" || true))" vim_coauthors="$(echo "${vim_coauthor0}"; echo "${vim_coauthors}")" # Remove Co-authored-by and Signed-off-by lines from the commit message. - vim_message="$(echo "${vim_message}" | grep -Ev '^(Co-authored|Signed-off)-by: ')" + vim_message="$(echo "${vim_message}" | grep -Ev '^(Co-[Aa]uthored|Signed-[Oo]ff)-[Bb]y: ')" if [[ ${munge_commit_line} == "true" ]]; then # Remove first line of commit message. vim_message="$(echo "${vim_message}" | sed -Ee '1s/^patch /vim-patch:/')"