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

Use only one level of indentation after opening paren (#127)
authorDaniel Hahler <git@thequod.de>
Sat, 11 May 2019 13:11:23 +0000 (15:11 +0200)
committerGitHub <noreply@github.com>
Sat, 11 May 2019 13:11:23 +0000 (15:11 +0200)
Fixes https://github.com/Vimjas/vim-python-pep8-indent/issues/126.

indent/python.vim
spec/indent/cython_spec.rb
spec/indent/indent_spec.rb

index 36ff12a86fd06a82a0b1d91e9daef0e8f69effa3..532bab585521c0f4cbbe1a08ab928768a1c05249 100644 (file)
@@ -214,7 +214,7 @@ function! s:indent_like_opening_paren(lnum)
         if starts_with_closing_paren && !hang_closing
             let res = base
         else
         if starts_with_closing_paren && !hang_closing
             let res = base
         else
-            let res = base + s:sw()
+            return base + s:sw()
         endif
     else
         " Indent to match position of opening paren.
         endif
     else
         " Indent to match position of opening paren.
index 933801df33d4b2dcd92f46544f33468cc117b438..03dcbb2ac02d3a79a6490575f9838dee28652963 100644 (file)
@@ -23,14 +23,14 @@ describe "vim for cython" do
   describe "when using a cdef function definition" do
       it "indents shiftwidth spaces" do
           vim.feedkeys 'icdef long_function_name(\<CR>arg'
   describe "when using a cdef function definition" do
       it "indents shiftwidth spaces" do
           vim.feedkeys 'icdef long_function_name(\<CR>arg'
-          indent.should == shiftwidth * 2
+          indent.should == shiftwidth
       end
   end
 
   describe "when using a cpdef function definition" do
       it "indents shiftwidth spaces" do
           vim.feedkeys 'icpdef long_function_name(\<CR>arg'
       end
   end
 
   describe "when using a cpdef function definition" do
       it "indents shiftwidth spaces" do
           vim.feedkeys 'icpdef long_function_name(\<CR>arg'
-          indent.should == shiftwidth * 2
+          indent.should == shiftwidth
       end
   end
 end
       end
   end
 end
index db66b8f0a877bdc20847f1b2f642b08238a371d8..641ad7e14145dee9d5b22ebb147f192a84022c03 100644 (file)
@@ -205,14 +205,14 @@ shared_examples_for "vim" do
   describe "when using a function definition" do
       it "indents shiftwidth spaces" do
           vim.feedkeys 'idef long_function_name(\<CR>arg'
   describe "when using a function definition" do
       it "indents shiftwidth spaces" do
           vim.feedkeys 'idef long_function_name(\<CR>arg'
-          indent.should == shiftwidth * 2
+          indent.should == shiftwidth
       end
   end
 
   describe "when using a class definition" do
       it "indents shiftwidth spaces" do
           vim.feedkeys 'iclass Foo(\<CR>'
       end
   end
 
   describe "when using a class definition" do
       it "indents shiftwidth spaces" do
           vim.feedkeys 'iclass Foo(\<CR>'
-          indent.should == shiftwidth * 2
+          indent.should == shiftwidth
       end
   end
 
       end
   end
 
@@ -430,7 +430,7 @@ shared_examples_for "vim" do
 
     it "ignores the call signature after a function" do
       vim.feedkeys 'idef f(  JEDI_CALL_SIGNATURE\<CR>'
 
     it "ignores the call signature after a function" do
       vim.feedkeys 'idef f(  JEDI_CALL_SIGNATURE\<CR>'
-      indent.should == shiftwidth * 2
+      indent.should == shiftwidth
     end
   end
 end
     end
   end
 end