aboutsummaryrefslogtreecommitdiff
path: root/evil-commands.el
diff options
context:
space:
mode:
authorFrank Fischer <frank.fischer@mathematik.tu-chemnitz.de>2013-05-23 20:17:41 +0200
committerFrank Fischer <frank.fischer@mathematik.tu-chemnitz.de>2013-05-23 20:17:41 +0200
commit3f1e0217149a9e9a655967f465154eb2560d7b06 (patch)
tree5e37d091c54555d130420f6207f2fdd1bd9c7ba8 /evil-commands.el
parent6c42b27dcc9da721b13fbe817e09a477f151af28 (diff)
Ensure `evil-delete-backward-word` only deletes newline at bol
If point is not at the beginning of the line, the this function should only delete characters on the current line, even if they are only whitespaces. This corresponds to Vim's default behaviour.
Diffstat (limited to 'evil-commands.el')
-rw-r--r--evil-commands.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/evil-commands.el b/evil-commands.el
index 36c6473..79e0a99 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -1194,9 +1194,11 @@ Save in REGISTER or in the kill-ring with YANK-HANDLER."
"Delete previous word."
(if (and (bolp) (not (bobp)))
(delete-char -1)
- (evil-delete (save-excursion
- (evil-backward-word-begin)
- (point))
+ (evil-delete (max
+ (save-excursion
+ (evil-backward-word-begin)
+ (point))
+ (line-beginning-position))
(point)
'exclusive
nil)))