Skip to content

Commit

Permalink
feat: add sp-comment-sexp
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuco1 committed Mar 20, 2024
1 parent ce1b3b9 commit 73acd2a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions smartparens.el
Original file line number Diff line number Diff line change
Expand Up @@ -9365,6 +9365,23 @@ comment."
(forward-line 1)
(indent-according-to-mode))))))))

(defun sp-comment-sexp ()
"Insert the comment character after point.

If there is a hanging sexp after the point, comment out the
entire hybrid sexp."
(interactive)
(save-excursion
(let* ((exp (if (sp-point-in-string)
(sp-get-string)
(sp-get-thing)))
(hexp (progn
(sp-get exp (goto-char :end-suf))
(sp-get-hybrid-sexp))))
(comment-or-uncomment-region
(sp-get exp (goto-char :beg-prf))
(sp-get hexp (goto-char :end-suf))))))

(defun sp-wrap-round ()
"Wrap following sexp in round parentheses."
(interactive "*")
Expand Down

0 comments on commit 73acd2a

Please sign in to comment.