Permalink
Browse files

clear screen as part of the command

This is a little faster and it also deals with race conditions when
`&t_te` and `t_ti` are doing things like enabling/disabling focus
tracking with vitality.vim.
  • Loading branch information...
1 parent 00f0d4d commit 64926ab8a3c8af68a9c5f06d05e7a1e6e26c8a0d @aaronjensen aaronjensen committed Feb 23, 2014
Showing with 11 additions and 3 deletions.
  1. +11 −3 autoload/vroom.vim
View
@@ -196,12 +196,11 @@ function s:Run(cmd)
end
endfunction
-" Internal: Clear the screen prior to running specs
+" Internal: Clear the screen prior to running specs for vimux
+" Otherwise, prefix the command with a clear.
function s:ClearScreen()
if g:vroom_use_vimux
call VimuxRunCommand("clear")
- else
- :silent !clear
endif
endfunction
@@ -238,6 +237,7 @@ function s:SetTestRunnerPrefix(filename)
call s:IsUsingBundleExec(a:filename)
call s:IsUsingBinstubs()
call s:IsUsingSpring()
+ call s:IsClearScreenEnabled()
endfunction
" Internal: Check for .zeus.sock and use zeus instead of bundler
@@ -291,6 +291,14 @@ function s:IsUsingSpring()
endif
endfunction
+" Internal: Check to see if we should clear the screen and prefixes
+" s:test_runner_prefix as neessary
+function s:IsClearScreenEnabled()
+ if g:vroom_clear_screen && !g:vroom_use_vimux
+ let s:test_runner_prefix = "clear; " . s:test_runner_prefix
+ endif
+endfunction
+
" Internal: Checks for Gemfile, and sets s:test_runner_prefix as necessary
function s:CheckForGemfile()
if s:GemfileExists()

0 comments on commit 64926ab

Please sign in to comment.