Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bug fix: Avoid Vim's hit-enter prompt

While publishing with the verbose option on to try to identify what's
slowing the plug-in down (apart from the 2html.vim script) I quickly
became annoyed at Vim's hit-enter prompt, which of course shouldn't be
able to interrupt an otherwise fully automated process. The plug-in now
makes sure the more option isn't set before executing.
  • Loading branch information...
commit 7a2705cbdcefa12116f6ca007af9683729c2b37a 1 parent e4664be
Peter Odding authored June 16, 2010

Showing 2 changed files with 10 additions and 2 deletions. Show diff stats Hide diff stats

  1. 10  autoload.vim
  2. 2  publish.vim
10  autoload.vim
... ...
@@ -1,6 +1,6 @@
1 1
 " Vim script
2 2
 " Maintainer: Peter Odding <peter@peterodding.com>
3  
-" Last Change: June 15, 2010
  3
+" Last Change: June 16, 2010
4 4
 " URL: http://peterodding.com/code/vim/publish
5 5
 
6 6
 function! publish#resolve_files(directory, pathnames) " {{{1
@@ -188,6 +188,14 @@ function! publish#prep_env(enable) " {{{1
188 188
     endif
189 189
   augroup END
190 190
 
  191
+  " Avoid the hit-enter prompt!
  192
+  if a:enable
  193
+    let s:more_save = &more
  194
+    set nomore
  195
+  else
  196
+    let &more = s:more_save
  197
+  endif
  198
+
191 199
   " Avoid triggering automatic commands intended to update `Last changed'
192 200
   " headers and such by executing :write commands, because the source files
193 201
   " aren't actually modified but only copied. I can't use :noautocmd :write
2  publish.vim
@@ -65,7 +65,6 @@ function! Publish(source, target, files) abort
65 65
     silent execute 'write!' fnameescape(target_path)
66 66
     bwipeout!
67 67
   endfor
68  
-  call publish#prep_env(0)
69 68
   unlet s:files_to_publish s:tags_to_publish
70 69
   if rsync_target != ''
71 70
     call publish#run_rsync(rsync_target, rsync_dir)
@@ -73,6 +72,7 @@ function! Publish(source, target, files) abort
73 72
   let msg = "publish.vim: Published %i file%s to %s."
74 73
   call xolox#message(msg, len(a:files), len(a:files) == 1 ? '' : 's', a:target)
75 74
   call xolox#timer#stop("Finished publishing files in %s.", start)
  75
+  call publish#prep_env(0)
76 76
 endfunction
77 77
 
78 78
 function! s:FindOriginalPath(pathname) " {{{1

0 notes on commit 7a2705c

Please sign in to comment.
Something went wrong with that request. Please try again.