File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1673,6 +1673,7 @@ of the block."
1673
1673
(funcall delete-func beg end type register yank-handler)
1674
1674
(cond
1675
1675
((eq type 'line )
1676
+ (setq this-command 'evil-change-whole-line ) ; for evil-maybe-remove-spaces
1676
1677
(if (= opoint (point ))
1677
1678
(evil-open-above 1 )
1678
1679
(evil-open-below 1 )))
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ commands opening a new line."
99
99
evil-open-below
100
100
evil-append
101
101
evil-append-line
102
+ evil-change-whole-line
102
103
newline
103
104
newline-and-indent
104
105
indent-and-newline)))
Original file line number Diff line number Diff line change @@ -2114,6 +2114,28 @@ for this test."))
2114
2114
ABCIf you want to create a file, visit that file with C-x C-f,
2115
2115
ABCthen enter the text in that file's own buffer.")))
2116
2116
2117
+ (ert-deftest evil-maybe-remove-spaces-test ()
2118
+ "Test maybe removing (indentation) spaces after some commands when making a clear line."
2119
+ :tags '(evil operator)
2120
+ (ert-info ("changing the line and returning to normal mode removes spaces")
2121
+ (evil-test-buffer
2122
+ (emacs-lisp-mode)
2123
+ ("i(one two" [return] "three" [return] "four" [return] "five" [escape] "?three" [return])
2124
+ "(one two
2125
+ [t]hree
2126
+ four
2127
+ five"
2128
+ ("cc" "new line" [escape] "+")
2129
+ "(one two
2130
+ new line
2131
+ [f]our
2132
+ five"
2133
+ ("cc" [escape])
2134
+ "(one two
2135
+ new line
2136
+ []
2137
+ five")))
2138
+
2117
2139
(ert-deftest evil-test-change-word ()
2118
2140
"Test changing words"
2119
2141
:tags '(evil operator)
You can’t perform that action at this time.
0 commit comments