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:
@@ -113,7 +113,11 @@ function! s:AddLicenseHeader(license) abort
|
|||||||
let line = substitute(line, 'AUTHOR', author, 'g')
|
let line = substitute(line, 'AUTHOR', author, 'g')
|
||||||
|
|
||||||
if line ==# ''
|
if line ==# ''
|
||||||
|
if comment_style.middle =~# '^\s*$'
|
||||||
|
call add(processed_lines, '')
|
||||||
|
else
|
||||||
call add(processed_lines, comment_style.middle)
|
call add(processed_lines, comment_style.middle)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
call add(processed_lines, comment_style.middle . ' ' . line)
|
call add(processed_lines, comment_style.middle . ' ' . line)
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user