From 1f603b18ac36ce56dcb6e6d2145bc84146e18f61 Mon Sep 17 00:00:00 2001 From: Tom Dalziel Date: Mon, 29 May 2023 20:35:12 +0100 Subject: Default to (point-min . point-max) for bnd --- evil-common.el | 3 ++- evil-tests.el | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/evil-common.el b/evil-common.el index c9d247e..f772cda 100644 --- a/evil-common.el +++ b/evil-common.el @@ -2972,7 +2972,8 @@ linewise, otherwise it is character wise." (let* ((count (or count 1)) (bnd (or (let ((b (bounds-of-thing-at-point thing))) (and b (< (point) (cdr b)) b)) - (evil-bounds-of-not-thing-at-point thing)))) + (evil-bounds-of-not-thing-at-point thing) + (cons (point-min) (point-max))))) ;; check if current object is selected (when (or (not beg) (not end) (> beg (car bnd)) diff --git a/evil-tests.el b/evil-tests.el index 601bacc..34850d7 100644 --- a/evil-tests.el +++ b/evil-tests.el @@ -6142,7 +6142,12 @@ Line 2")) (evil-test-buffer " foo [b]ar" ("daw") - " fo[o]")))) + " fo[o]"))) + (ert-info ("Deleting whitespace on whitepsace only line") + (evil-test-buffer + "foo\n[ ]\nbar" + ("diw") + "foo\n[]\nbar"))) (ert-deftest evil-test-word-objects-cjk () "Test `evil-inner-word' and `evil-a-word' on CJK words" -- cgit v1.0