blob: 1b3ea830d78efcac685ea14f0dac763b731b4002 (
plain) (
tree)
|
|
function! html#timestamp#Update() abort
if !&modified
return
endif
let l:cv = winsaveview()
call cursor(1,1)
let l:li = search('\C^\s*<em>Last updated: .\+</em>$', 'n')
if l:li
let l:date = substitute(system('date -u'), '\C\n$', '', '')
let l:line = getline(l:li)
call setline(l:li, substitute(l:line, '\C\S.*',
\ '<em>Last updated: '.l:date.'</em>', ''))
endif
call winrestview(l:cv)
endfunction
|