Remove broken evil-join

This commit is contained in:
MitchMarq42 2023-03-06 18:47:03 -09:00
parent 8f151251ca
commit 3721f7e072

View File

@ -28,52 +28,6 @@ Made solely to reduce lines in the init-file."
(interactive)
(evil-next-line)
(scroll-up-line))
;; Make evil-join combine lines. Taken from https://github.com/doomemacs/doomemacs/blob/master/modules/editor/evil/autoload/advice.el#L180
;;;###autoload (autoload '+evil-join-a "lisp/mitch-defuns" nil nil)
;; (defun +evil-join-a (fn beg end)
;; "Join the selected lines.
;; This advice improves on `evil-join' by removing comment delimiters when joining
;; commented lines, without `fill-region-as-paragraph'.
;; Adapted from https://github.com/emacs-evil/evil/issues/606"
;; (if-let* (((not (= (line-end-position) (point-max))))
;; (cend (save-excursion (goto-char end) (line-end-position)))
;; (cbeg (save-excursion
;; (goto-char beg)
;; (and (doom-point-in-comment-p
;; (save-excursion
;; (goto-char (line-beginning-position 2))
;; (skip-syntax-forward " \t")
;; (point)))
;; (or (comment-search-backward (line-beginning-position) t)
;; (comment-search-forward (line-end-position) t)
;; (and (doom-point-in-comment-p beg)
;; (stringp comment-continue)
;; (or (search-forward comment-continue (line-end-position) t)
;; beg)))))))
;; (let* ((count (count-lines beg end))
;; (count (if (> count 1) (1- count) count))
;; (fixup-mark (make-marker)))
;; (uncomment-region (line-beginning-position 2)
;; (save-excursion
;; (goto-char cend)
;; (line-end-position 0)))
;; (unwind-protect
;; (dotimes (_ count)
;; (join-line 1)
;; (save-match-data
;; (when (or (and comment-continue
;; (not (string-empty-p comment-continue))
;; (looking-at (concat "\\(\\s-*" (regexp-quote comment-continue) "\\) ")))
;; (and comment-start-skip
;; (not (string-empty-p comment-start-skip))
;; (looking-at (concat "\\(\\s-*" comment-start-skip "\\)"))))
;; (replace-match "" t nil nil 1)
;; (just-one-space))))
;; (set-marker fixup-mark nil)))
;; ;; But revert to the default we're not in a comment, where
;; ;; `fill-region-as-paragraph' is too greedy.
;; (funcall fn beg end)))
;; (advice-add #'evil-join :override #'+evil-join-a)
)
(defun mitch/visual-setup ()
"Commands to run when setting up any display. To be called in use-package