Skip to content

Commit

Permalink
Support delete-section; fixes #682.
Browse files Browse the repository at this point in the history
racket-hash-lang-delete-backward-char should delete the selection when
delete-selection-mode is enabled.
  • Loading branch information
greghendershott committed Nov 30, 2023
1 parent c1bcc33 commit 3cadfa3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion racket-hash-lang.el
Original file line number Diff line number Diff line change
Expand Up @@ -768,13 +768,14 @@ You may customize this default initialization in
(racket--hash-lang-plain-self-insert close-char))))))

(defun racket-hash-lang-delete-backward-char ()
"Delete previous character, and when between a pair, following character."
"Delete previous character, and following character when matching pair."
(interactive)
(pcase (assq (char-before) racket-hash-lang-pairs)
(`(,_open ,close . ,_ )
(when (eq close (char-after))
(delete-char 1))))
(delete-char -1))
(put 'racket-hash-lang-delete-backward-char 'delete-selection 'supersede)

;;; Fill

Expand Down

0 comments on commit 3cadfa3

Please sign in to comment.