Skip to content

Commit

Permalink
Avoid rest
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 24, 2023
1 parent c01a9da commit 037975a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vs-comment-return.el
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,23 @@
(defvar-local vs-comment-return--return-last-p nil
"Store weather we hit return twice in a row.")

(defun vs-comment-return--pre-command ()
(defun vs-comment-return--pre-command (&rest _)
"Execution before command's execution."
(add-hook 'post-self-insert-hook #'vs-comment-return--post-self-insert nil t)
(add-hook 'post-command-hook #'vs-comment-return--post-command nil t)
;; De-register ourselves!
(remove-hook 'pre-command-hook #'vs-comment-return--pre-command t))

(defun vs-comment-return--post-command ()
(defun vs-comment-return--post-command (&rest _)
"Execution after command's execution."
;; De-register ourselves!
(remove-hook 'post-command-hook #'vs-comment-return--post-command t)
;; Cancel action!
(remove-hook 'post-self-insert-hook #'vs-comment-return--post-self-insert t))

(defun vs-comment-return--post-self-insert ()
(defun vs-comment-return--post-self-insert (&rest _)
"Execution after self insertion."
(msgu-unsilent (ic-message "????"))
(when (and vs-comment-return-cancel-after
(eq last-command-event ?\n)
(vs-comment-return--line-empty-p))
Expand Down

0 comments on commit 037975a

Please sign in to comment.