aboutsummaryrefslogtreecommitdiff
path: root/evil-commands.el
diff options
context:
space:
mode:
authorEivind Fonn <evfonn@gmail.com>2019-07-29 09:04:33 +0200
committerEivind Fonn <evfonn@gmail.com>2019-07-29 09:04:33 +0200
commit874beba2cb243c325eca08fb7badff567f3c9494 (patch)
treea51797b264c425ae73cc6df66038e8a820b4110f /evil-commands.el
parent249f8677d9d2c10f4e90c18303db83e2151d3ef8 (diff)
parentb450e0f49400211426a18d86a6ae35e182457a84 (diff)
Merge branch 'more-visual'
Diffstat (limited to 'evil-commands.el')
-rw-r--r--evil-commands.el38
1 files changed, 31 insertions, 7 deletions
diff --git a/evil-commands.el b/evil-commands.el
index 1b65854..d860238 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -652,16 +652,28 @@ Movement is restricted to the current line unless `evil-cross-lines' is non-nil.
:type inclusive
(interactive "<c><C>")
(setq count (or count 1))
- (let ((fwd (> count 0)))
+ (let ((fwd (> count 0))
+ (visual (and evil-respect-visual-line-mode
+ visual-line-mode)))
(setq evil-last-find (list #'evil-find-char char fwd))
(when fwd (forward-char))
(let ((case-fold-search nil))
(unless (prog1
(search-forward (char-to-string char)
- (unless evil-cross-lines
- (if fwd
- (line-end-position)
- (line-beginning-position)))
+ (cond (evil-cross-lines
+ nil)
+ ((and fwd visual)
+ (save-excursion
+ (end-of-visual-line)
+ (point)))
+ (fwd
+ (line-end-position))
+ (visual
+ (save-excursion
+ (beginning-of-visual-line)
+ (point)))
+ (t
+ (line-beginning-position)))
t count)
(when fwd (backward-char)))
(user-error "Can't find %c" char)))))
@@ -2354,7 +2366,16 @@ non nil it should be number > 0. The insertion will be repeated
in the next VCOUNT - 1 lines below the current one."
(interactive "p")
(push (point) buffer-undo-list)
- (back-to-indentation)
+ (if (and visual-line-mode
+ evil-respect-visual-line-mode)
+ (goto-char
+ (max (save-excursion
+ (back-to-indentation)
+ (point))
+ (save-excursion
+ (beginning-of-visual-line)
+ (point))))
+ (back-to-indentation))
(setq evil-insert-count count
evil-insert-lines nil
evil-insert-vcount
@@ -2371,7 +2392,10 @@ The insertion will be repeated COUNT times. If VCOUNT is non nil
it should be number > 0. The insertion will be repeated in the
next VCOUNT - 1 lines below the current one."
(interactive "p")
- (evil-move-end-of-line)
+ (if (and visual-line-mode
+ evil-respect-visual-line-mode)
+ (evil-end-of-visual-line)
+ (evil-move-end-of-line))
(setq evil-insert-count count
evil-insert-lines nil
evil-insert-vcount