Skip to content

Commit

Permalink
Update insert-activate-mark functionality to use built in mechanics
Browse files Browse the repository at this point in the history
`push-mark' already has the functionality to conditionally enable the
mark so we should use that instead.
  • Loading branch information
Haxxflaxx committed Nov 30, 2024
1 parent 9126e98 commit 44dc689
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions meow-command.el
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The direction of selection is MARK -> POS."
(message "Mark set"))
nil)

(defun meow--select (selection &optional backward)
(defun meow--select (selection &optional backward keep-disabled)
"Mark the SELECTION."
(let* ((old-sel-type (meow--selection-type))
(sel-type (car selection))
Expand All @@ -84,7 +84,7 @@ The direction of selection is MARK -> POS."
(cond
((null old-sel-type)
(goto-char to-go)
(push-mark to-mark t t))
(push-mark to-mark t (not keep-disabled)))
(t
(goto-char to-go)
(set-mark to-mark)))
Expand Down
4 changes: 1 addition & 3 deletions meow-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
(not (= (point) meow--insert-pos)))
(thread-first
(meow--make-selection '(select . transient) meow--insert-pos (point))
(meow--select))
(when (not meow--insert-activate-mark)
(deactivate-mark)))
(meow--select nil (not meow--insert-activate-mark))))
(run-hooks 'meow-insert-exit-hook)
(setq-local meow--insert-pos nil
meow--insert-activate-mark nil)))
Expand Down

0 comments on commit 44dc689

Please sign in to comment.