From: Hynek Schlawack Date: Sat, 9 Nov 2013 15:08:57 +0000 (-0800) Subject: Merge pull request #19 from kljohann/tests X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/b0bb7f66733400fe8ac914fab8860aec8d38b915?hp=502aea33111e33371315b4b5e93f4ba3452dbf80 Merge pull request #19 from kljohann/tests Run test cases for different sets of settings While we care only about 4 spaces, running it with both may uncover subtle bugs. --- diff --git a/indent/python.vim b/indent/python.vim index c632c7b..4d1edc2 100644 --- a/indent/python.vim +++ b/indent/python.vim @@ -3,7 +3,6 @@ " Maintainer: Hynek Schlawack " Prev Maintainer: Eric Mc Sween (address invalid) " Original Author: David Bustos (address invalid) -" Last Change: 2012-06-21 " License: Public Domain " Only load this indent file when no other was loaded. @@ -176,6 +175,12 @@ function! GetPythonPEPIndent(lnum) " If the previous line ended with a colon and is not a comment, indent " relative to statement start. + let pline = substitute(pline, '\\\\', '', 'g') + if v:version > 703 || (v:version == 703 && has('patch1037')) + let pline = substitute(pline, '".\{-}\\\@1pass' + indent.should == shiftwidth + end + end + + describe "when '#' is not contained in a string and is followed by a colon" do + it "does not indent" do + vim.feedkeys 'iif "some#thing" == "test"#:test\' + indent.should == 0 + end + end + describe "when using simple control structures" do it "indents shiftwidth spaces" do vim.feedkeys 'iwhile True:\pass'