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 @@ -330,7 +330,7 @@ function! s:indent_like_previous_line(lnum)
330330 return -1
331331 endif
332332
333- if ! empty && s: is_dedented_already (current, base)
333+ if (current || ! empty ) && s: is_dedented_already (current, base)
334334 return -1
335335 endif
336336
Original file line number Diff line number Diff line change 700700 proposed_indent . should == 0
701701 end
702702end
703+
704+ describe "Using O" do
705+ before { vim . feedkeys 'iif foo:\<CR>' }
706+
707+ it "respects autoindent" do
708+ vim . feedkeys '1\<CR>\<CR>'
709+ indent . should == shiftwidth
710+ vim . feedkeys '\<Esc>ko'
711+ indent . should == shiftwidth
712+ vim . feedkeys '\<Esc>kO'
713+ indent . should == shiftwidth
714+ # Uses/keeps indent from line above
715+ vim . feedkeys '\<Esc>i2\<Esc>O'
716+ indent . should == shiftwidth
717+ # Uses/keeps indent from line above
718+ vim . feedkeys '\<Esc>j\<Esc>O'
719+ indent . should == 0
720+ end
721+ end
You can’t perform that action at this time.
0 commit comments