From 01e8a5145160620140c3c57d285ccb2cfe067540 Mon Sep 17 00:00:00 2001 From: Pham Huy Hoang Date: Thu, 16 Mar 2023 19:04:17 +0900 Subject: feat(python): add "return" patterns to @indent_end `return ...` is usually the last line of a function/statement, so mark some possible patterns of `return` with `@indent_end` to dedent the line after it --- queries/python/indents.scm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'queries/python') diff --git a/queries/python/indents.scm b/queries/python/indents.scm index c02879712..cc13587ec 100644 --- a/queries/python/indents.scm +++ b/queries/python/indents.scm @@ -72,6 +72,15 @@ (list_pattern "]" @indent_end) +(return_statement + [ + (_) @indent_end + (_ (_) @indent_end .) + (attribute + attribute: (_) @indent_end) + "return" @indent_end + ] .) + [ ")" "]" -- cgit v1.2.3-70-g09d2