From 5ffa6315de2535670db6dbea118f6352c387244a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Fri, 10 Jul 2026 16:07:44 +0200 Subject: [PATCH] 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> --- plugin/licenser.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/licenser.vim b/plugin/licenser.vim index d8a2953..55e9689 100644 --- a/plugin/licenser.vim +++ b/plugin/licenser.vim @@ -113,7 +113,11 @@ function! s:AddLicenseHeader(license) abort let line = substitute(line, 'AUTHOR', author, 'g') if line ==# '' - call add(processed_lines, comment_style.middle) + 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