X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/7665325e833a60a9217f7e62c37069ef6b359d18..61e1c4d6a5c90ba0222cd58198ccc0232433f90c:/spec/indent/indent_spec.rb?ds=inline diff --git a/spec/indent/indent_spec.rb b/spec/indent/indent_spec.rb index 400ec11..9c52235 100644 --- a/spec/indent/indent_spec.rb +++ b/spec/indent/indent_spec.rb @@ -502,11 +502,26 @@ shared_examples_for "multiline strings" do end describe "when after a docstring" do - before { vim.feedkeys 'i """' } it "it does indent the next line to the docstring" do - vim.feedkeys '\' + vim.feedkeys 'i """\' + indent.should == 4 + proposed_indent.should == 4 + end + + it "indents the closing docstring quotes" do + vim.feedkeys 'i """\\"""' indent.should == 4 proposed_indent.should == 4 + vim.echo('getline(3)').should == ' """' + end + + it "indents non-matching docstring quotes" do + vim.feedkeys 'i """\\' + vim.feedkeys "0C'''" + vim.echo('line(".")').should == "4" + vim.echo('getline(".")').should == "'''" + indent.should == 0 + proposed_indent.should == -1 end end @@ -685,3 +700,22 @@ describe "Compact multiline dict" do proposed_indent.should == 0 end end + +describe "Using O" do + before { vim.feedkeys 'iif foo:\' } + + it "respects autoindent" do + vim.feedkeys '1\\' + indent.should == shiftwidth + vim.feedkeys '\ko' + indent.should == shiftwidth + vim.feedkeys '\kO' + indent.should == shiftwidth + # Uses/keeps indent from line above + vim.feedkeys '\i2\O' + indent.should == shiftwidth + # Uses/keeps indent from line above + vim.feedkeys '\j\O' + indent.should == 0 + end +end