From 502fb46d840a731f850c7f4cf2ed4476451c4907 Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Tue, 4 Apr 2023 11:46:00 -0400 Subject: [PATCH 1/2] Improve evil-change's handling of screen-lines When the type is screen-line and multiple real lines are spanned, make evil-change behave like it does for the line type (e.g., by adding and indenting a new line after deletion). Partially fixes #1407 --- evil-commands.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evil-commands.el b/evil-commands.el index d44d3ab7..fbd3a8f4 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -1696,7 +1696,9 @@ of the block." (evil-start-undo-step)) (funcall delete-func beg end type register yank-handler) (cond - ((eq type 'line) + ((or (eq type 'line) + (and (eq type 'screen-line) + (> nlines 1))) (setq this-command 'evil-change-whole-line) ; for evil-maybe-remove-spaces (cond ((/= opoint leftmost-point) (evil-insert 1)) ; deletion didn't delete line From d3503a9779c48e68b5a90745fb67d5ef30dcbf4d Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Thu, 22 Jun 2023 16:27:48 -0400 Subject: [PATCH 2/2] Make evil-delete aware of screen-lines --- evil-commands.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evil-commands.el b/evil-commands.el index fbd3a8f4..d5e3a01a 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -1516,7 +1516,7 @@ Save in REGISTER or in the kill-ring with YANK-HANDLER." (cond ((eq type 'block) (evil-apply-on-block #'delete-region beg end nil)) - ((and (eq type 'line) + ((and (memq type '(line screen-line)) (= end (point-max)) (or (= beg end) (/= (char-before end) ?\n))