Only invoke last change substitution in help files

Previously the `autocmd` to replace the date on the first line if `Last
change: ` was present resulted in the cursor being moved in non `help`
filetypes due to the substitution failing. Now the substitution is only
attempted if the current file is a `help` file.
This commit is contained in:
2019-04-04 16:53:46 +01:00
parent bdea77f86a
commit 72fe59ffaa
2 changed files with 9 additions and 1 deletions

View File

@@ -78,3 +78,11 @@ function! do#debug(...)
endfor
exec l:command
endfunction
function! do#last_change()
if &filetype ==# 'help'
" vint: next-line -ProhibitCommandRelyOnUser -ProhibitCommandWithUnintendedSideEffect
1s/Last change: \zs.*$/\=strftime('%Y %b %d')/e
norm!``
endif
endfunction