abo-abo / lispy

Short and sweet LISP editing
http://oremacs.com/lispy/
1.2k stars 130 forks source link

`lispy-delete-backward` doesn't seem to respect rectangle mode #629

Open rmNULL opened 2 years ago

rmNULL commented 2 years ago

Hi, i noticed some unexpected behavior when deleting text in rectangle mode. i've attached a short screen recording displaying this behavior, which explains better than the following text.

What happened

Tried to rectangle mark and kill cdr of each the sub-lists, lispy deleted all the elements except the first.

What was expected

I hoped it would only kill the selected region as the retaining result would have been a valid s-exp.

Recording

https://user-images.githubusercontent.com/8173131/162836295-0018918f-fa73-4003-a3a7-f5ad69e33572.mp4

Config used in the recording

(setq user-emacs-directory (make-temp-file "emacs-clean-init" t))

(defvar straight-repository-branch "master")
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(setq initial-scratch-message
      (format ";;; (dired \"%s\")" user-emacs-directory))

(straight-use-package 'use-package)

(use-package lispy
         :straight t
         :hook
  (emacs-lisp-mode-hook . lispy-mode))

;; included for completeness
(use-package gif-screencast
  :straight (gif-screencast :type git
                :host gitlab
                :repo "ambrevar/emacs-gif-screencast")
  :bind
  (:map gif-screencast-mode-map
    ("<f8>" . gif-screencast-toggle-pause))
  (:map global-map
    ("<f9>" . gif-screencast-start-or-stop)))

Thanks.