mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-23 22:20:24 -08:00
Improve region deletion handling in python.el
* lisp/progmodes/python.el (python-indent-dedent-line-backspace): Delete the text in the region if Transient Mark mode is enabled, the mark is active, and prefix arg is 1. (Bug#48695) * test/lisp/progmodes/python-tests.el (python-indent-dedent-line-backspace-4): Add new test.
This commit is contained in:
parent
2846dd8842
commit
e52ed1b5d1
3 changed files with 31 additions and 3 deletions
|
|
@ -1967,10 +1967,13 @@ indentation levels from right to left."
|
|||
|
||||
(defun python-indent-dedent-line-backspace (arg)
|
||||
"De-indent current line.
|
||||
Argument ARG is passed to `backward-delete-char-untabify' when
|
||||
point is not in between the indentation."
|
||||
Argument ARG is passed to `backward-delete-char-untabify' when point is
|
||||
not in between the indentation or when Transient Mark mode is enabled,
|
||||
the mark is active, and ARG is 1."
|
||||
(interactive "*p")
|
||||
(unless (python-indent-dedent-line)
|
||||
(when (or
|
||||
(and (use-region-p) (= arg 1))
|
||||
(not (python-indent-dedent-line)))
|
||||
(backward-delete-char-untabify arg)))
|
||||
|
||||
(put 'python-indent-dedent-line-backspace 'delete-selection 'supersede)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue