X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/d9efc9643da118f0928f204d2c5d3ce0e987eb44..60ba5e11a61618c0344e2db190210145083c91f8:/spec/indent/bytes_spec.rb 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