Skip to content

Commit

Permalink
fix: make commands play nice with delete-selection-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hrehfeld committed May 16, 2022
1 parent 8fa81ce commit e06525c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions smart-hungry-delete.el
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ With prefix argument ARG, just delete a single char."
(prefix-command-preserve-state)
(smart-hungry-delete-char arg t))

(put #'smart-hungry-delete-backward-char 'delete-selection 'kill)

;;;###autoload
(defun smart-hungry-delete-forward-char (arg)
"If there is more than one char of whitespace between point and next word,
Expand All @@ -148,6 +150,8 @@ With prefix argument ARG, just delete a single char."
(prefix-command-preserve-state)
(smart-hungry-delete-char arg))

(put #'smart-hungry-delete-forward-char 'delete-selection 'kill)

(defun smart-hungry-delete-char-trigger (to from)
"Return t if the region (TO FROM) should be killed completely."
(save-excursion
Expand Down

0 comments on commit e06525c

Please sign in to comment.