X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/d9efc9643da118f0928f204d2c5d3ce0e987eb44..88333bde264a6cb4d81f68a962bfc0d883e7ed39:/spec/indent/bytes_spec.rb?ds=inline diff --git a/spec/indent/bytes_spec.rb b/spec/indent/bytes_spec.rb index 260a2ab..3d6744e 100644 --- a/spec/indent/bytes_spec.rb +++ b/spec/indent/bytes_spec.rb @@ -3,6 +3,7 @@ require "spec_helper" describe "handles byte strings" do before(:all) { vim.command 'syn region pythonBytes start=+[bB]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesError,pythonBytesContent,@Spell' + vim.command "syn match pythonBytesEscape '\\\\$'" } before(:each) { @@ -23,4 +24,13 @@ describe "handles byte strings" do vim.feedkeys 'o' indent.should == 0 end + + it "it indents backslash continuation correctly" do + vim.feedkeys 'iwith foo, \\' + vim.echo('getline(".")').should == "with foo, \\" + vim.echo('map(synstack(line("."), col(".")), "synIDattr(v:val, \"name\")")' + ).should == "['pythonBytesEscape']" + vim.feedkeys 'o' + indent.should == 8 + end end