[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#71170: 30.0.50; hs-hide-all in python mode not works as expected
From: |
lorniu |
Subject: |
bug#71170: 30.0.50; hs-hide-all in python mode not works as expected |
Date: |
Sun, 26 May 2024 12:39:03 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Maybe patch like this can avoid too much newlines between hidden blocks.
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 79e383a1c1a..26546df13c4 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5734,7 +5734,12 @@ python-describe-at-point
(defun python-hideshow-forward-sexp-function (_arg)
"Python specific `forward-sexp' function for `hs-minor-mode'.
Argument ARG is ignored."
- (python-nav-end-of-block))
+ (python-nav-end-of-block)
+ (end-of-line)
+ (let ((pt (point)))
+ (skip-chars-forward " \n\t")
+ (re-search-backward "\n\n" nil t)
+ (when (< (point) pt) (goto-char pt))))
--
Mess.