diff --git a/plugin/gtm.vim b/plugin/gtm.vim index 5dc03f0..5c894c6 100644 --- a/plugin/gtm.vim +++ b/plugin/gtm.vim @@ -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