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 plugin_path = File.expand_path('../..', __FILE__)
28 vim.command "set rtp^=#{plugin_path}"
29 vim.command "set filetype=python"
32 @shiftwidth ||= vim.echo("exists('*shiftwidth') ? shiftwidth() : &sw").to_i
35 @tabstop ||= vim.echo("&tabstop").to_i
38 vim.echo("indent('.')").to_i
41 pline = vim.echo("line('.')").to_i - 1
42 vim.echo("indent('#{pline}')").to_i
45 line = vim.echo("line('.')")
46 col = vim.echo("col('.')")
47 indent_value = vim.echo("GetPythonPEPIndent(#{line})").to_i
48 vim.command("call cursor(#{line}, #{col})")
51 def multiline_indent(prev, default)
52 i = vim.echo("get(g:, 'python_pep8_indent_multiline_string', 0)").to_i
53 return (i == -2 ? default : i), i < 0 ? (i == -1 ? prev : default) : i
56 i = vim.echo("get(g:, 'python_pep8_indent_hang_closing', 0)").to_i
59 def set_hang_closing(value)
61 vim.command("let g:python_pep8_indent_hang_closing=#{i}")