Add empty line for whitespace-only comment markers

When a license header line is empty and comment_style.middle
contains only whitespace characters, add a truly empty line
instead of the whitespace-only marker. This improves the
formatting of license headers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-07-10 16:07:44 +02:00
parent 9a05e38d38
commit 5ffa6315de
+4
View File
@@ -113,7 +113,11 @@ function! s:AddLicenseHeader(license) abort
let line = substitute(line, 'AUTHOR', author, 'g')
if line ==# ''
if comment_style.middle =~# '^\s*$'
call add(processed_lines, '')
else
call add(processed_lines, comment_style.middle)
endif
else
call add(processed_lines, comment_style.middle . ' ' . line)
endif