nit(evil): revise & reformat comments

For clarity and to conform to newer conventions.
This commit is contained in:
Henrik Lissner
2025-03-25 15:21:54 -04:00
parent ad7d9fa657
commit b29449434b
2 changed files with 16 additions and 15 deletions

View File

@ -143,9 +143,9 @@ more information on modifiers."
"Same as `evil-window-split', but correctly updates the window history."
:repeat nil
(interactive "P<f>")
;; HACK This ping-ponging between the destination and source windows is to
;; update the window focus history, so that, if you close either split
;; afterwards you won't be sent to some random window.
;; HACK: This ping-ponging between the destination and source windows is to
;; update the window focus history, so that, if you close either split
;; afterwards you won't be sent to some random window.
(let ((origwin (selected-window))
window-selection-change-functions)
(select-window (split-window origwin count 'below))
@ -162,9 +162,9 @@ more information on modifiers."
"Same as `evil-window-split', but correctly updates the window history."
:repeat nil
(interactive "P<f>")
;; HACK This ping-ponging between the destination and source windows is to
;; update the window focus history, so that, if you close either split
;; afterwards you won't be sent to some random window.
;; HACK: This ping-ponging between the destination and source windows is to
;; update the window focus history, so that, if you close either split
;; afterwards you won't be sent to some random window.
(let ((origwin (selected-window))
window-selection-change-functions)
(select-window (split-window origwin count 'right))

View File

@ -139,17 +139,18 @@ directives. By default, this only recognizes C directives.")
(count-lines (point-min) (point-max))
(buffer-size)))))
;; REVIEW In evil, registers 2-9 are buffer-local. In vim, they're global,
;; so... Perhaps this should be PRed upstream?
;; HACK: In vim, registers 2-9 are global. In Evil, they're buffer-local. so
;; I enforce vim's way.
;; REVIEW: PR this upstream?
(defadvice! +evil--make-numbered-markers-global-a (char)
:after-until #'evil-global-marker-p
(and (>= char ?2) (<= char ?9)))
;; Make J (evil-join) remove comment delimiters when joining lines.
;; HACK: Fix joining commented lines with J (evil-join).
(advice-add #'evil-join :around #'+evil-join-a)
;; Prevent gw (`evil-fill') and gq (`evil-fill-and-move') from squeezing
;; spaces. It doesn't in vim, so it shouldn't in evil.
;; HACK: Prevent gw (`evil-fill') and gq (`evil-fill-and-move') from squeezing
;; spaces. It doesn't in vim, so it shouldn't in evil.
(defadvice! +evil--no-squeeze-on-fill-a (fn &rest args)
:around '(evil-fill evil-fill-and-move)
(letf! (defun fill-region (from to &optional justify nosqueeze to-eop)
@ -159,12 +160,12 @@ directives. By default, this only recognizes C directives.")
;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'.
(advice-add #'evil-force-normal-state :after #'+evil-escape-a)
;; monkey patch `evil-ex-replace-special-filenames' to improve support for
;; file modifiers like %:p:h. This adds support for most of vim's modifiers,
;; and one custom one: %:P (expand to the project root).
;; HACK: Enhance `evil-ex-replace-special-filenames' to add support for
;; Vim-like Ex file modifiers like %:p:h. Most vim's modifiers are
;; supported, plus one custom one: %:P (expands to the project's root).
(advice-add #'evil-ex-replace-special-filenames :override #'+evil-replace-filename-modifiers-a)
;; make `try-expand-dabbrev' (from `hippie-expand') work in minibuffer
;; HACK: Make `try-expand-dabbrev' (from `hippie-expand') work in minibuffer
(add-hook 'minibuffer-inactive-mode-hook #'+evil--fix-dabbrev-in-minibuffer-h)
;; Focus and recenter new splits