]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge branch 'master' into searchpair-timeout
authorDaniel Hahler <git@thequod.de>
Sat, 17 Nov 2018 18:39:10 +0000 (19:39 +0100)
committerDaniel Hahler <git@thequod.de>
Sat, 17 Nov 2018 18:39:10 +0000 (19:39 +0100)
indent/python.vim
spec/indent/indent_spec.rb

index b5ea8a994eb3661953473b1a7203e2e86e51a77b..977ec05f0a55a9719af64feff18baf5d9a1cf452 100644 (file)
@@ -330,7 +330,7 @@ function! s:indent_like_previous_line(lnum)
         return -1
     endif
 
-    if !empty && s:is_dedented_already(current, base)
+    if (current || !empty) && s:is_dedented_already(current, base)
         return -1
     endif
 
index 68b545f68b22799d0f16514ed63f72eaba1e4a06..9c52235d37204b99ea3b72d3110370b23a9e32ba 100644 (file)
@@ -700,3 +700,22 @@ describe "Compact multiline dict" do
     proposed_indent.should == 0
   end
 end
+
+describe "Using O" do
+  before { vim.feedkeys 'iif foo:\<CR>' }
+
+  it "respects autoindent" do
+    vim.feedkeys '1\<CR>\<CR>'
+    indent.should == shiftwidth
+    vim.feedkeys '\<Esc>ko'
+    indent.should == shiftwidth
+    vim.feedkeys '\<Esc>kO'
+    indent.should == shiftwidth
+    # Uses/keeps indent from line above
+    vim.feedkeys '\<Esc>i2\<Esc>O'
+    indent.should == shiftwidth
+    # Uses/keeps indent from line above
+    vim.feedkeys '\<Esc>j\<Esc>O'
+    indent.should == 0
+  end
+end