File tree Expand file tree Collapse file tree 2 files changed +38
-7
lines changed Expand file tree Collapse file tree 2 files changed +38
-7
lines changed Original file line number Diff line number Diff line change @@ -1530,12 +1530,13 @@ Save in REGISTER or in the kill-ring with YANK-HANDLER."
1530
1530
(last-command 'next-line ))
1531
1531
(evil-delete beg end 'block register yank-handler))
1532
1532
(evil-delete beg end type register yank-handler)
1533
- (evil-first-non-blank)
1534
- (when (and (not evil-start-of-line) evil-operator-start-col)
1535
- (move-to-column (if (and (eq most-positive-fixnum temporary-goal-column)
1536
- (memq last-command '(next-line previous-line)))
1537
- temporary-goal-column
1538
- evil-operator-start-col))))))
1533
+ (when (eq 'line type)
1534
+ (evil-first-non-blank)
1535
+ (when (and (not evil-start-of-line) evil-operator-start-col)
1536
+ (move-to-column (if (and (eq most-positive-fixnum temporary-goal-column)
1537
+ (memq last-command '(next-line previous-line)))
1538
+ temporary-goal-column
1539
+ evil-operator-start-col)))))))
1539
1540
1540
1541
(evil-define-operator evil-delete-whole-line
1541
1542
(beg end type register yank-handler)
Original file line number Diff line number Diff line change @@ -2166,7 +2166,37 @@ ine3 line3 line3 l\n"))
2166
2166
;; This is line three"
2167
2167
(" v$D" )
2168
2168
" ;; This is line one
2169
- ;; This is line three" )))
2169
+ ;; This is line three" ))
2170
+ (ert-info (" Deletion in normal state leaves point in the right place" )
2171
+ (evil-test-buffer
2172
+ " alpha b[r]avo charlie\n delta echo foxtrot\n golf hotel india"
2173
+ (should (not evil-start-of-line))
2174
+ (" D" )
2175
+ " alpha [b]\n delta echo foxtrot\n golf hotel india"
2176
+ (" /echo" [return] " C" " newtext" [escape])
2177
+ " alpha b\n delta newtex[t]\n golf hotel india" )
2178
+ (let ((evil-start-of-line t ))
2179
+ (evil-test-buffer
2180
+ " alpha b[r]avo charlie\n delta echo foxtrot\n golf hotel india"
2181
+ (" D" )
2182
+ " alpha [b]\n delta echo foxtrot\n golf hotel india"
2183
+ (" /echo" [return] " C" " newtext" [escape])
2184
+ " alpha b\n delta newtex[t]\n golf hotel india" )))
2185
+ (ert-info (" Line deletion in visual state leaves point in the right place" )
2186
+ (evil-test-buffer
2187
+ " alpha [b]ravo charlie\n delta echo foxtrot\n golf hotel india"
2188
+ (should (not evil-start-of-line))
2189
+ (" vD" )
2190
+ " delta [e]cho foxtrot\n golf hotel india"
2191
+ (" vX" )
2192
+ " golf h[o]tel india" )
2193
+ (let ((evil-start-of-line t ))
2194
+ (evil-test-buffer
2195
+ " alpha [b]ravo charlie\n delta echo foxtrot\n golf hotel india"
2196
+ (" vD" )
2197
+ " [d]elta echo foxtrot\n golf hotel india"
2198
+ (" vX" )
2199
+ " [g]olf hotel india" ))))
2170
2200
2171
2201
(ert-deftest evil-test-delete-folded ()
2172
2202
" Test `evil-delete' on folded lines."
You can’t perform that action at this time.
0 commit comments