From 02a6e69a4ee772600c38919094c50487f6838559 Mon Sep 17 00:00:00 2001 From: Junlan Liu Date: Mon, 26 Mar 2018 19:11:06 -0400 Subject: [PATCH] Fix #826 --- autoload/pymode/folding.vim | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/autoload/pymode/folding.vim b/autoload/pymode/folding.vim index 1df35eea..9cbb64d3 100644 --- a/autoload/pymode/folding.vim +++ b/autoload/pymode/folding.vim @@ -228,17 +228,11 @@ fun! s:BlockStart(lnum) "{{{ " W: don't Wrap around the end of the file let previous_definition = searchpos(s:def_regex, 'bnW') - " Corner case of function being defined on the first line. - if previous_definition[0] == 1 - " Just skip the while loop. - elseif previous_definition != [0, 0] - " Lines that are blank have zero indent. - while previous_definition != [0, 0] - \ && indent(previous_definition[0]) >= l:inferred_indent - let previous_definition = searchpos(s:def_regex, 'bnW') - call cursor(previous_definition[0] - 1, 0) - endwhile - endif + while previous_definition[0] != 1 && previous_definition != [0, 0] + \ && indent(previous_definition[0]) >= l:inferred_indent + let previous_definition = searchpos(s:def_regex, 'bnW') + call cursor(previous_definition[0] - 1, 0) + endwhile let last_def = previous_definition[0] if last_def call cursor(last_def, 0) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy