mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
(py-execute-region): Alexander Schmolck points out that leading
whitespace can hose the needs-if test. So just skip all blank lines at the start of the region right off the bat.
This commit is contained in:
parent
69d31b749d
commit
4aab68e1c1
1 changed files with 7 additions and 0 deletions
|
|
@ -1378,6 +1378,13 @@ window) so you can see it, and a comment of the form
|
|||
|
||||
is inserted at the end. See also the command `py-clear-queue'."
|
||||
(interactive "r\nP")
|
||||
;; Skip ahead to the first non-blank line
|
||||
(goto-char start)
|
||||
(beginning-of-line)
|
||||
(while (and (looking-at "\\s *$")
|
||||
(< (point) end))
|
||||
(forward-line 1))
|
||||
(setq start (point))
|
||||
(or (< start end)
|
||||
(error "Region is empty"))
|
||||
(let* ((proc (get-process py-which-bufname))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue