File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ function! s:indent_like_previous_line(lnum)
313313 return -1
314314 endif
315315
316- if ! empty && s: is_dedented_already (current, base)
316+ if (current || ! empty ) && s: is_dedented_already (current, base)
317317 return -1
318318 endif
319319
Original file line number Diff line number Diff line change 685685 proposed_indent . should == 0
686686 end
687687end
688+
689+ describe "Using O" do
690+ before { vim . feedkeys 'iif foo:\<CR>' }
691+
692+ it "respects autoindent" do
693+ vim . feedkeys '1\<CR>\<CR>'
694+ indent . should == shiftwidth
695+ vim . feedkeys '\<Esc>ko'
696+ indent . should == shiftwidth
697+ vim . feedkeys '\<Esc>kO'
698+ indent . should == shiftwidth
699+ # Uses/keeps indent from line above
700+ vim . feedkeys '\<Esc>i2\<Esc>O'
701+ indent . should == shiftwidth
702+ # Uses/keeps indent from line above
703+ vim . feedkeys '\<Esc>j\<Esc>O'
704+ indent . should == 0
705+ end
706+ end
You can’t perform that action at this time.
0 commit comments