X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/b0d020f899c720469eaea8bfe50e71285ad053e6..85bbe4706aa1666a90fc89684ad0787521d9df6e:/spec/indent/indent_spec.rb?ds=inline diff --git a/spec/indent/indent_spec.rb b/spec/indent/indent_spec.rb index e60da62..400ec11 100644 --- a/spec/indent/indent_spec.rb +++ b/spec/indent/indent_spec.rb @@ -401,10 +401,22 @@ shared_examples_for "vim" do end describe "when an else is used inside of a nested if" do - before { vim.feedkeys 'iif foo:\\if bar:\\\pass\' } - it "indents an else to the inner if" do + before { vim.feedkeys 'iif foo:\if bar:\pass\' } + it "indents the else to the inner if" do vim.feedkeys 'else:' - indent.should == shiftwidth * 2 + indent.should == shiftwidth + end + end + + describe "when an else is used outside of a nested if" do + before { vim.feedkeys 'iif True:\if True:\pass\\0' } + it "indents the else to the outer if" do + indent.should == 0 + proposed_indent.should == shiftwidth + + vim.feedkeys 'ielse:' + indent.should == 0 + proposed_indent.should == 0 end end