Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugin/gtm.vim
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@ let s:gtm_plugin_status = ''
function! s:record()
let fpath = expand('%:p')
" record if file path has changed or last update is greater than update_interval
if s:last_file != fpath || localtime() - s:last_update > s:update_interval
if filereadable(fpath) && (s:last_file != fpath || localtime() - s:last_update > s:update_interval)
let s:cmd = (g:gtm_plugin_status_enabled == 1 ? 'gtm record --status' : 'gtm record')
let output=system(s:cmd . ' ' . shellescape(fpath))
if v:shell_error
echoerr s:no_gtm_err
echom "Trying to record file: ".. fpath
echom "With command: ".. s:cmd .. ' ' .. shellescape(fpath)
echom output
else
let s:gtm_plugin_status = (g:gtm_plugin_status_enabled ? substitute(output, '\n\+$', '', '') : '')
endif
Expand Down