endfunc
+function! InsertMultiline(multiline_text) abort
+ " Split the input at newlines, handling both Unix (\n) and Windows (\r\n) formats
+ let lines = split(a:multiline_text, '\r\n\|\n')
+
+ " Replace current line with first line
+ call setline('.', lines[0])
+
+ " Append remaining lines if they exist
+ if len(lines) > 1
+ call append('.', lines[1:])
+ endif
+endfunction
+
func! CommentMeNow()
return $USER_INITIALS . ' ' . strftime('%d.%m.%y')
endfunc
endif
let comment = split(comment,'\s\+')
- " NB 09.06.25: For css
- " let comment = substitute(comment,'\n','\r','g')
"call CommentSubSpecialChar(comment)
let curr_line = getline('.')
"let new_line = substitute(new_line,'\n',"\n",'g')
endif
- call setline('.',new_line)
+ call InsertMultiline(new_line)
+ " NB 09.06.25 call setline('.',new_line)
endfunc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""