Skip to content

Commit 61e1c4d

Browse files
committed
Merge branch 'master' into searchpair-timeout
2 parents 80f44e7 + 8d64e05 commit 61e1c4d

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

indent/python.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

spec/indent/indent_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,3 +700,22 @@
700700
proposed_indent.should == 0
701701
end
702702
end
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

0 commit comments

Comments
 (0)