From e2267fe1da0d3d9581e8d77a2cd6795a7cec02f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johann=20Kl=C3=A4hn?= Date: Sun, 10 Nov 2013 09:03:50 +0100 Subject: [PATCH 1/1] fix regression for multiple parens of different types --- indent/python.vim | 2 +- spec/indent/indent_spec.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/indent/python.vim b/indent/python.vim index 3b64cf4..6fb1889 100644 --- a/indent/python.vim +++ b/indent/python.vim @@ -80,7 +80,7 @@ function! s:find_opening_paren(...) call filter(positions, 'v:val[0]') call sort(positions, 's:pair_sort') - return get(positions, 0, [0, 0]) + return get(positions, -1, [0, 0]) endfunction " Find the start of a multi-line statement diff --git a/spec/indent/indent_spec.rb b/spec/indent/indent_spec.rb index df402e8..4652ef9 100644 --- a/spec/indent/indent_spec.rb +++ b/spec/indent/indent_spec.rb @@ -67,6 +67,18 @@ shared_examples_for "vim" do end end + describe "when after multiple parens of different types" do + it "indents by one level" do + vim.feedkeys 'if({\' + indent.should == shiftwidth + end + + it "lines up with the last paren" do + vim.feedkeys 'ifff({123: 456,\' + indent.should == 5 + end + end + describe "when '#' is contained in a string that is followed by a colon" do it "indents by one level" do vim.feedkeys 'iif "some#thing" == "test":#test\pass' -- 2.39.5