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'
4 # Explicitly enable usage of "should".
5 RSpec.configure do |config|
6 config.expect_with(:rspec) { |c| c.syntax = :should }
9 Vimrunner::RSpec.configure do |config|
10 # Use a single Vim instance for the test suite. Set to false to use an
11 # instance per test (slower, but can be easier to manage).
12 # This requires using gvim, otherwise it hangs after a few tests.
13 config.reuse_server = ENV['VIMRUNNER_REUSE_SERVER'] == '1' ? true : false
16 vim = config.reuse_server ? Vimrunner.start_gvim : Vimrunner.start
17 plugin_path = File.expand_path('../..', __FILE__)
19 # add_plugin appends the path to the rtp... :(
20 # vim.add_plugin(plugin_path, 'indent/python.vim')
22 vim.command "set rtp^=#{plugin_path}"
23 vim.command "runtime syntax/python.vim"
24 vim.command "runtime indent/python.vim"
27 @shiftwidth ||= vim.echo("exists('*shiftwidth') ? shiftwidth() : &sw").to_i
30 @tabstop ||= vim.echo("&tabstop").to_i
33 vim.echo("indent('.')").to_i
36 pline = vim.echo("line('.')").to_i - 1
37 vim.echo("indent('#{pline}')").to_i
40 line = vim.echo("line('.')")
41 col = vim.echo("col('.')")
42 indent_value = vim.echo("GetPythonPEPIndent(#{line})").to_i
43 vim.command("call cursor(#{line}, #{col})")
46 def multiline_indent(prev, default)
47 i = vim.echo("get(g:, 'python_pep8_indent_multiline_string', 0)").to_i
48 return (i == -2 ? default : i), i < 0 ? (i == -1 ? prev : default) : i
51 i = vim.echo("get(g:, 'python_pep8_indent_hang_closing', 0)").to_i
54 def set_hang_closing(value)
56 vim.command("let g:python_pep8_indent_hang_closing=#{i}")