Skip to content

Commit

Permalink
Bug fix: Avoid Vim's hit-enter prompt
Browse files Browse the repository at this point in the history
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
xolox committed Jun 16, 2010
1 parent e4664be commit 7a2705c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion autoload.vim
@@ -1,6 +1,6 @@
" Vim script
" Maintainer: Peter Odding <peter@peterodding.com>
" Last Change: June 15, 2010
" Last Change: June 16, 2010
" URL: http://peterodding.com/code/vim/publish

function! publish#resolve_files(directory, pathnames) " {{{1
Expand Down Expand Up @@ -188,6 +188,14 @@ function! publish#prep_env(enable) " {{{1
endif
augroup END

" Avoid the hit-enter prompt!
if a:enable
let s:more_save = &more
set nomore
else
let &more = s:more_save
endif

" Avoid triggering automatic commands intended to update `Last changed'
" headers and such by executing :write commands, because the source files
" aren't actually modified but only copied. I can't use :noautocmd :write
Expand Down
2 changes: 1 addition & 1 deletion publish.vim
Expand Up @@ -65,14 +65,14 @@ function! Publish(source, target, files) abort
silent execute 'write!' fnameescape(target_path)
bwipeout!
endfor
call publish#prep_env(0)
unlet s:files_to_publish s:tags_to_publish
if rsync_target != ''
call publish#run_rsync(rsync_target, rsync_dir)
endif
let msg = "publish.vim: Published %i file%s to %s."
call xolox#message(msg, len(a:files), len(a:files) == 1 ? '' : 's', a:target)
call xolox#timer#stop("Finished publishing files in %s.", start)
call publish#prep_env(0)
endfunction

function! s:FindOriginalPath(pathname) " {{{1
Expand Down

0 comments on commit 7a2705c

Please sign in to comment.