Skip to content

Commit 8c347a6

Browse files
authored
Use only one level of indentation after opening paren (#127)
Fixes #126.
1 parent 68c34f9 commit 8c347a6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

indent/python.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function! s:indent_like_opening_paren(lnum)
214214
if starts_with_closing_paren && !hang_closing
215215
let res = base
216216
else
217-
let res = base + s:sw()
217+
return base + s:sw()
218218
endif
219219
else
220220
" Indent to match position of opening paren.

spec/indent/cython_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
describe "when using a cdef function definition" do
2424
it "indents shiftwidth spaces" do
2525
vim.feedkeys 'icdef long_function_name(\<CR>arg'
26-
indent.should == shiftwidth * 2
26+
indent.should == shiftwidth
2727
end
2828
end
2929

3030
describe "when using a cpdef function definition" do
3131
it "indents shiftwidth spaces" do
3232
vim.feedkeys 'icpdef long_function_name(\<CR>arg'
33-
indent.should == shiftwidth * 2
33+
indent.should == shiftwidth
3434
end
3535
end
3636
end

spec/indent/indent_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,14 @@
205205
describe "when using a function definition" do
206206
it "indents shiftwidth spaces" do
207207
vim.feedkeys 'idef long_function_name(\<CR>arg'
208-
indent.should == shiftwidth * 2
208+
indent.should == shiftwidth
209209
end
210210
end
211211

212212
describe "when using a class definition" do
213213
it "indents shiftwidth spaces" do
214214
vim.feedkeys 'iclass Foo(\<CR>'
215-
indent.should == shiftwidth * 2
215+
indent.should == shiftwidth
216216
end
217217
end
218218

@@ -430,7 +430,7 @@
430430

431431
it "ignores the call signature after a function" do
432432
vim.feedkeys 'idef f( JEDI_CALL_SIGNATURE\<CR>'
433-
indent.should == shiftwidth * 2
433+
indent.should == shiftwidth
434434
end
435435
end
436436
end

0 commit comments

Comments
 (0)