From 09e433ec7f8b2c25d5be2cdb5aac5e089a6e4cea Mon Sep 17 00:00:00 2001 From: kobarity Date: Sat, 23 Jul 2022 10:26:33 +0200 Subject: Fix Python navigation problem with a line continuation using backslash * lisp/progmodes/python.el (python-nav--beginning-of-defun): Fix line continuation using backslash in nested defun (bug#56615). --- lisp/progmodes/python.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f31832fec9c..ec7d6572200 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1459,8 +1459,11 @@ With positive ARG search backwards, else search forwards." (current-indentation))) (body-indentation (and (> arg 0) - (or (and (python-info-looking-at-beginning-of-defun) - (+ (current-indentation) python-indent-offset)) + (or (and (python-info-looking-at-beginning-of-defun nil t) + (+ (save-excursion + (python-nav-beginning-of-statement) + (current-indentation)) + python-indent-offset)) (save-excursion (while (and -- cgit v1.2.1