]> 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:

fix regression for multiple parens of different types
authorJohann Klähn <kljohann@gmail.com>
Sun, 10 Nov 2013 08:03:50 +0000 (09:03 +0100)
committerJohann Klähn <kljohann@gmail.com>
Sat, 4 Jan 2014 10:50:23 +0000 (11:50 +0100)
indent/python.vim
spec/indent/indent_spec.rb

index 3b64cf4263985de8341580f6ca77b9857ed5832f..6fb188903dd98a175755cc8c079890fc84564857 100644 (file)
@@ -80,7 +80,7 @@ function! s:find_opening_paren(...)
     call filter(positions, 'v:val[0]')
     call sort(positions, 's:pair_sort')
 
     call filter(positions, 'v:val[0]')
     call sort(positions, 's:pair_sort')
 
-    return get(positions, 0, [0, 0])
+    return get(positions, -1, [0, 0])
 endfunction
 
 " Find the start of a multi-line statement
 endfunction
 
 " Find the start of a multi-line statement
index df402e8cb9fc25c11f984d2b8fa4656865b5f24f..4652ef9762ecb4302957ab480a959d6de61db78b 100644 (file)
@@ -67,6 +67,18 @@ shared_examples_for "vim" do
     end
   end
 
     end
   end
 
+  describe "when after multiple parens of different types" do
+    it "indents by one level" do
+      vim.feedkeys 'if({\<CR>'
+      indent.should == shiftwidth
+    end
+
+    it "lines up with the last paren" do
+      vim.feedkeys 'ifff({123: 456,\<CR>'
+      indent.should == 5
+    end
+  end
+
   describe "when '#' is contained in a string that is followed by a colon" do
     it "indents by one level" do
         vim.feedkeys 'iif "some#thing" == "test":#test\<CR>pass'
   describe "when '#' is contained in a string that is followed by a colon" do
     it "indents by one level" do
         vim.feedkeys 'iif "some#thing" == "test":#test\<CR>pass'