Просмотр исходного кода

Do not print 'D'-message when there was no update (#66)

This commit assumes that the git pull command prints 'Already
up-to-date' when the repository is up-to-date. Let's just hope that it
doesn't change in the future.
Junegunn Choi 11 лет назад
Родитель
Сommit
99f6f36b69
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      plug.vim

+ 2 - 1
plug.vim

@@ -558,7 +558,8 @@ function! s:finish(pull)
   if !empty(s:prev_update.errors)
     call add(msgs, "Press 'R' to retry.")
   endif
-  if a:pull
+  if a:pull && !empty(filter(getline(5, '$'),
+                \ "v:val =~ '^- ' && stridx(v:val, 'Already up-to-date') < 0"))
     call add(msgs, "Press 'D' to see the updated changes.")
   endif
   echo join(msgs, ' ')