aboutsummaryrefslogtreecommitdiff
path: root/evil-vars.el
diff options
context:
space:
mode:
authorJustin Burkett <justin@burkett.cc>2019-08-08 21:50:50 -0400
committerEivind Fonn <evfonn@gmail.com>2019-11-19 11:34:20 +0100
commit5365e4d79f7f9c9e04d8d4f9b02b087791c18db2 (patch)
treeea047fe8d9012bf3e60a00d431b9d9a1ee0bb6ae /evil-vars.el
parent92102f3b30d03d1d87b34ae2c01e4bc2013d5129 (diff)
Make more commands support visual-line-mode
when evil-respect-visual-line-mode is non-nil, including evil-change-line, evil-delete-line, and evil-yank-line. Most of the work is done through the motions evil-line-or-visual-line and evil-end-of-line-or-visual-line. These motions use visual lines when visual-line-mode and evil-respect-visual-line-mode are non-nil, and revert back to standard lines otherwise. Visual selection via visual lines in the sense of visual-line-mode is supported by adding a new screen-line type (named to avoid confusion with visual state).
Diffstat (limited to 'evil-vars.el')
-rw-r--r--evil-vars.el17
1 files changed, 4 insertions, 13 deletions
diff --git a/evil-vars.el b/evil-vars.el
index d95450c..d10a4a8 100644
--- a/evil-vars.el
+++ b/evil-vars.el
@@ -218,18 +218,7 @@ a line."
(defcustom evil-respect-visual-line-mode nil
"Whether movement commands respect `visual-line-mode'.
-This variable must be set before Evil is loaded. When
-`visual-line-mode' is active, the following commands are swapped
-
-`evil-next-line' <-> `evil-next-visual-line'
-`evil-previous-line' <-> `evil-previous-visual-line'
-`evil-beginning-of-line' <-> `evil-beginning-of-visual-line'
-`evil-end-of-line' <-> `evil-end-of-visual-line'
-
-The commands `evil-insert-line', `evil-append-line',
-`evil-find-char', `evil-find-char-backward', `evil-find-char-to'
-and `evil-find-char-to-backward' are also made aware of visual
-lines."
+This variable must be set before Evil is loaded."
:type 'boolean
:group 'evil)
@@ -506,7 +495,9 @@ The default behavior is to yank the whole line."
:set #'(lambda (sym value)
(evil-add-command-properties
'evil-yank-line
- :motion (if value 'evil-end-of-line 'evil-line))))
+ :motion (if value
+ 'evil-end-of-line-or-visual-line
+ 'evil-line-or-visual-line))))
(defcustom evil-disable-insert-state-bindings nil
"Whether insert state bindings should be used. Excludes