[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 348d9b9 8/8: magit-section: Fix immediate selec
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 348d9b9 8/8: magit-section: Fix immediate selection highlighting |
Date: |
Tue, 12 Oct 2021 14:57:48 -0400 (EDT) |
branch: elpa/git-commit
commit 348d9b98614c824be3e2f05eef5ab91d67f6695e
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-section: Fix immediate selection highlighting
Fixes a regression introduced in [1: bac25e73c].
1: 2021-08-29 bac25e73c50fda8ed319cebb69f20e56f8bc7376
Avoid needless selection re-highlighting
---
Documentation/RelNotes/3.4.0.org | 3 +++
lisp/magit-section.el | 8 +++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/Documentation/RelNotes/3.4.0.org b/Documentation/RelNotes/3.4.0.org
index 5543fe9..a1b62bb 100644
--- a/Documentation/RelNotes/3.4.0.org
+++ b/Documentation/RelNotes/3.4.0.org
@@ -13,3 +13,6 @@
- Worktree commands and listing worktrees in the status buffer were
broken inside remote repositories that are accessed using Tramp.
#4326
+
+- Due to a regression in v3.3.0 setting the mark did not highlight the
+ current and only selected section until a second section is selected.
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 7f04a72..0706f9b 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -1243,12 +1243,14 @@ evaluated its BODY. Admittedly that's a bit of a hack."
;;; Highlight
+(defvar-local magit-section-pre-command-region-p nil)
(defvar-local magit-section-pre-command-section nil)
(defvar-local magit-section-highlight-overlays nil)
(defvar-local magit-section-highlighted-sections nil)
(defvar-local magit-section-unhighlight-sections nil)
(defun magit-section-pre-command-hook ()
+ (setq magit-section-pre-command-region-p (region-active-p))
(setq magit-section-pre-command-section (magit-current-section)))
(defun magit-section-deactivate-mark ()
@@ -1256,7 +1258,11 @@ evaluated its BODY. Admittedly that's a bit of a hack."
(defun magit-section-update-highlight (&optional force)
(let ((section (magit-current-section)))
- (when (or force (not (eq magit-section-pre-command-section section)))
+ (when (or force
+ (cond ; `xor' wasn't added until 27.1.
+ ((not magit-section-pre-command-region-p) (region-active-p))
+ ((not (region-active-p)) magit-section-pre-command-region-p))
+ (not (eq magit-section-pre-command-section section)))
(let ((inhibit-read-only t)
(deactivate-mark nil)
(selection (magit-region-sections)))
- [nongnu] elpa/git-commit updated (cabcc9c -> 348d9b9), ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit b137e7d 1/8: magit-save-repository-buffers: Fix saving of remote buffers, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit ba9caff 2/8: magit-save-repository-buffers: Assert file is writable, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 7aa314c 4/8: Fix worktree commands when using tramp, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 197f51f 5/8: magit-list-worktree: Make sure all paths are worktrees, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 0b9927d 7/8: magit-section: Fix :package-version of options, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 09333d6 3/8: magit-save-repository-buffers: Rearrange and improve comments, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 7a94132 6/8: Rename magit-keep-region-overlay to magit-section-keep-region-overlay, ELPA Syncer, 2021/10/12
- [nongnu] elpa/git-commit 348d9b9 8/8: magit-section: Fix immediate selection highlighting,
ELPA Syncer <=