File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ let s:block_rules = {
4040 \ ' ^\s*finally\>' : [' try' , ' except' , ' else' ]
4141 \ }
4242let s: paren_pairs = [' ()' , ' {}' , ' []' ]
43- let s: control_statement = ' ^\s*\(if\|while\|with\|for\|except\)\>'
43+ let s: control_statement = ' ^\s*\(class\|def\| if\|while\|with\|for\|except\)\>'
4444let s: stop_statement = ' ^\s*\(break\|continue\|raise\|return\|pass\)\>'
4545
4646" Skip strings and comments
Original file line number Diff line number Diff line change 198198 end
199199 end
200200
201+ describe "when using a function definition" do
202+ it "indents shiftwidth spaces" do
203+ vim . feedkeys 'idef long_function_name(\<CR>arg'
204+ indent . should == shiftwidth * 2
205+ end
206+ end
207+
208+ describe "when using a class definition" do
209+ it "indents shiftwidth spaces" do
210+ vim . feedkeys 'iclass Foo(\<CR>'
211+ indent . should == shiftwidth * 2
212+ end
213+ end
214+
201215 describe "when writing an 'else' block" do
202216 it "aligns to the preceeding 'for' block" do
203217 vim . feedkeys 'ifor x in "abc":\<CR>pass\<CR>else:'
You can’t perform that action at this time.
0 commit comments