##// END OF EJS Templates
Fix behaviour of dedent triggering. Closes gh-142.
David Warde-Farley -
Show More
@@ -103,7 +103,13 b" ESC_PAREN = '/' # Call first argument with rest of line as arguments"
103 # while developing.
103 # while developing.
104
104
105 # compiled regexps for autoindent management
105 # compiled regexps for autoindent management
106 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
106 dedent_re = re.compile('|'.join([
107 r'^\s+raise(\s.*)?$', # raise statement (+ space + other stuff, maybe)
108 r'^\s+raise\([^\)]*\).*$', # wacky raise with immediate open paren
109 r'^\s+return(\s.*)?$', # normal return (+ space + other stuff, maybe)
110 r'^\s+return\([^\)]*\).*$', # wacky return with immediate open paren
111 r'^\s+pass\s*$' # pass (optionally followed by trailing spaces)
112 ]))
107 ini_spaces_re = re.compile(r'^([ \t\r\f\v]+)')
113 ini_spaces_re = re.compile(r'^([ \t\r\f\v]+)')
108
114
109 # regexp to match pure comment lines so we don't accidentally insert 'if 1:'
115 # regexp to match pure comment lines so we don't accidentally insert 'if 1:'
General Comments 0
You need to be logged in to leave comments. Login now