From b29449434b04a774a09d09955dba6dd0bd4ddf72 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 25 Mar 2025 15:21:54 -0400 Subject: [PATCH] nit(evil): revise & reformat comments For clarity and to conform to newer conventions. --- modules/editor/evil/autoload/advice.el | 12 ++++++------ modules/editor/evil/config.el | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/editor/evil/autoload/advice.el b/modules/editor/evil/autoload/advice.el index 1cf4e5aa4..7d7a0b1b1 100644 --- a/modules/editor/evil/autoload/advice.el +++ b/modules/editor/evil/autoload/advice.el @@ -143,9 +143,9 @@ more information on modifiers." "Same as `evil-window-split', but correctly updates the window history." :repeat nil (interactive "P") - ;; 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") - ;; 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)) diff --git a/modules/editor/evil/config.el b/modules/editor/evil/config.el index c6ced7c30..e5e704bc7 100644 --- a/modules/editor/evil/config.el +++ b/modules/editor/evil/config.el @@ -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