All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 require 'vimrunner/rspec'
3 require 'vimrunner/server'
5 # Explicitly enable usage of "should".
6 RSpec.configure do |config|
7 config.expect_with(:rspec) { |c| c.syntax = :should }
10 Vimrunner::RSpec.configure do |config|
11 # Use a single Vim instance for the test suite. Set to false to use an
12 # instance per test (slower, but can be easier to manage).
13 # This requires using gvim, otherwise it hangs after a few tests.
14 config.reuse_server = ENV['VIMRUNNER_REUSE_SERVER'] == '1' ? true : false
17 exe = config.reuse_server ? Vimrunner::Platform.gvim : Vimrunner::Platform.vim
18 vimrc = File.expand_path("../vimrc", __FILE__)
19 vim = Vimrunner::Server.new(:executable => exe,
20 :vimrc => vimrc).start
21 # More friendly killing.
22 # Otherwise profiling information might not be written.
27 sleep 0.1 while server.running?
31 plugin_path = File.expand_path('../..', __FILE__)
32 vim.command "set rtp^=#{plugin_path}"
33 vim.command "set filetype=python"
36 @shiftwidth ||= vim.echo("exists('*shiftwidth') ? shiftwidth() : &sw").to_i
39 @tabstop ||= vim.echo("&tabstop").to_i
42 vim.echo("indent('.')").to_i
45 pline = vim.echo("line('.')").to_i - 1
46 vim.echo("indent('#{pline}')").to_i
49 line = vim.echo("line('.')")
50 col = vim.echo("col('.')")
51 indent_value = vim.echo("GetPythonPEPIndent(#{line})").to_i
52 vim.command("call cursor(#{line}, #{col})")
55 def multiline_indent(prev, default)
56 i = vim.echo("get(g:, 'python_pep8_indent_multiline_string', 0)").to_i
57 return (i == -2 ? default : i), i < 0 ? (i == -1 ? prev : default) : i
60 i = vim.echo("get(g:, 'python_pep8_indent_hang_closing', 0)").to_i
63 def set_hang_closing(value)
65 vim.command("let g:python_pep8_indent_hang_closing=#{i}")