[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil e2ec733b05 3/6: Remove str-conversions in evil-visual
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil e2ec733b05 3/6: Remove str-conversions in evil-visual-block-corner |
Date: |
Thu, 29 Dec 2022 12:58:49 -0500 (EST) |
branch: elpa/evil
commit e2ec733b056c27f0d6c819e6bf6adbbdc0ef8316
Author: Axel Forsman <axelsfor@gmail.com>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>
Remove str-conversions in evil-visual-block-corner
---
evil-states.el | 44 ++++++++++++++------------------------------
evil-types.el | 6 ++----
2 files changed, 16 insertions(+), 34 deletions(-)
diff --git a/evil-states.el b/evil-states.el
index a7242c226a..2bdf015927 100644
--- a/evil-states.el
+++ b/evil-states.el
@@ -281,7 +281,7 @@ the selection is enabled.
;; refresh the :corner property
(setq evil-visual-properties
(plist-put evil-visual-properties :corner
- (evil-visual-block-corner 'upper-left))))
+ (evil-visual-block-corner))))
(evil-define-state visual
"Visual state."
@@ -812,37 +812,21 @@ the horizontal or vertical component of CORNER is used.
CORNER defaults to `upper-left'."
(let* ((point (or point (point)))
(mark (or mark (mark t)))
- (corner (symbol-name
- (or corner
- (and (overlayp evil-visual-overlay)
- (overlay-get evil-visual-overlay
- :corner))
- 'upper-left)))
+ (corner (or corner
+ (when (overlayp evil-visual-overlay)
+ (overlay-get evil-visual-overlay :corner))
+ 'upper-left))
(point-col (evil-column point))
(mark-col (evil-column mark))
- horizontal vertical)
- (cond
- ((= point-col mark-col)
- (setq horizontal
- (or (and (string-match "left\\|right" corner)
- (match-string 0 corner))
- "left")))
- ((< point-col mark-col)
- (setq horizontal "left"))
- ((> point-col mark-col)
- (setq horizontal "right")))
- (cond
- ((= (line-number-at-pos point)
- (line-number-at-pos mark))
- (setq vertical
- (or (and (string-match "upper\\|lower" corner)
- (match-string 0 corner))
- "upper")))
- ((< point mark)
- (setq vertical "upper"))
- ((> point mark)
- (setq vertical "lower")))
- (intern (format "%s-%s" vertical horizontal))))
+ (upperp (if (= (line-number-at-pos point) (line-number-at-pos mark))
+ (memq corner '(upper-left upper-right))
+ (< point mark)))
+ (leftp (if (= point-col mark-col)
+ (memq corner '(upper-left lower-left))
+ (< point-col mark-col))))
+ (if upperp
+ (if leftp 'upper-left 'upper-right)
+ (if leftp 'lower-left 'lower-right))))
;;; Operator-Pending state
diff --git a/evil-types.el b/evil-types.el
index d457158208..645d2cfd03 100644
--- a/evil-types.el
+++ b/evil-types.el
@@ -104,10 +104,8 @@ and will be removed in a future version."
:contract (lambda (beg end)
(evil-range beg (max beg (1- end))))
:normalize (lambda (beg end)
- (goto-char end)
- (when (eq (char-after) ?\n)
- (setq end (max beg (1- end))))
- (evil-range beg end))
+ (evil-range beg (if (eq (char-after end) ?\n)
+ (max beg (1- end)) end)))
:string (lambda (beg end)
(let ((width (- end beg)))
(format "%s character%s" width
- [nongnu] elpa/evil updated (2e8576188b -> 13f01f6245), ELPA Syncer, 2022/12/29
- [nongnu] elpa/evil 1226944a5d 4/6: Remove some unnecessary evil-normalize-position:s, ELPA Syncer, 2022/12/29
- [nongnu] elpa/evil e2ec733b05 3/6: Remove str-conversions in evil-visual-block-corner,
ELPA Syncer <=
- [nongnu] elpa/evil a87d5fd1ad 5/6: evil-core: don't change match data in the advice of set-window-buffer, ELPA Syncer, 2022/12/29
- [nongnu] elpa/evil be6b09bcec 2/6: Make visual block selection after j/k match Vim, ELPA Syncer, 2022/12/29
- [nongnu] elpa/evil 0c535d6dab 1/6: Simplify temporary-goal-column logic, ELPA Syncer, 2022/12/29
- [nongnu] elpa/evil 13f01f6245 6/6: Make evil-mode-line-format recognise nil value, ELPA Syncer, 2022/12/29