Skip to content
Browse files

improving the patch by introducing a buffer to which vim will write t…

…he log to. Untested
  • Loading branch information...
1 parent 29c34be commit 4ee69afa986d767bfbea36f3f5f6aab5b279eab5 @MarcWeber committed Aug 4, 2012
Showing with 17 additions and 2 deletions.
  1. +12 −1 autoload/vam.vim
  2. +1 −1 autoload/vam/utils.vim
  3. +4 −0 doc/vim-addon-manager-getting-started.txt
View
13 autoload/vam.vim
@@ -46,6 +46,14 @@ let s:c['addon_completion_lhs'] = get(s:c, 'addon_completion_lhs', '<C-x><C-p>')
let s:c['debug_activation'] = get(s:c, 'debug_activation', 0)
let s:c['pool_item_check_fun'] = get(s:c, 'pool_item_check_fun', 'none')
+" experimental: will be documented when its tested
+" don't echo lines, add them to a buffer to prevent those nasty "Press Enter"
+" to show more requests by Vim
+" TODO: move log code into other file (such as utils.vim) because its not used on each startup
+" TODO: think about autowriting it
+let s:c['log_to_buf'] = get(s:c, 'log_to_buf', 0)
+let s:c['vam_log_buffer_name'] = get(s:c, 'vam_log_buffer_name', s:c.plugin_root_dir.'/VAM_LOG.txt')
+
" More options that are used for plugins’ installation are listed in
" autoload/vam/install.vim
@@ -380,7 +388,10 @@ endfun
" looks like an error but is not. Catches users attention. Logs to :messages
fun! vam#Log(s, ...)
- if !exists('g:vam_silent_log') || g:vam_silent_log == 0
+ if s:c.log_to_buf
+ silent! exec 'e '.fnameescape(s:c.vam_log_buffer_name)
@ZyX-I
Collaborator
ZyX-I added a note Aug 5, 2012

:silent! e? You really want to add garbage to unsaved user file in case it cannot be hidden?

Will replace this with split without any silencing at all.

@ZyX-I
Collaborator
ZyX-I added a note Aug 5, 2012
  • Without error silencing.
@MarcWeber
Owner
MarcWeber added a note Aug 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ cal append('$', split(a:s, "\n", 1))
+ else
let hi = a:0 > 0 ? a:1 : 'WarningMsg'
exec 'echohl '. hi
for l in split(a:s, "\n", 1)
View
2 autoload/vam/utils.vim
@@ -18,7 +18,7 @@ let s:http_cmd = exists('g:netrw_http_cmd') ?
" for testing it is necessary to avoid the "Press enter to continue lines".
" Thus provide an option making all shell commands use “system”
-let s:c['shell_commands_run_method'] = get(s:c, 'shell_commands_run_method', 'bang')
+let s:c['shell_commands_run_method'] = get(s:c, 'shell_commands_run_method', s:c.log_to_buf ? 'system' : 'bang')
" insert arguments at placeholders $ shell escaping the value
" usage: s:shellescape("rm --arg $ -fr $p $p $p", [string, file1, file2, file3])
View
4 doc/vim-addon-manager-getting-started.txt
@@ -395,4 +395,8 @@ Also see https://github.com/MarcWeber/vim-addon-manager/issues/77:
\'auto_install': 1,
\}
<
+
+Also see experimental log_to_buf option (just set it or read code. It'll be
+documented later)
+
vim: tw=78:ts=8:ft=help:norl

0 comments on commit 4ee69af

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