[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/add-vdiff 4596948 081/258: Reduce load in vdiff--scroll-f
From: |
Justin Burkett |
Subject: |
[elpa] scratch/add-vdiff 4596948 081/258: Reduce load in vdiff--scroll-function |
Date: |
Wed, 17 May 2017 08:13:27 -0400 (EDT) |
branch: scratch/add-vdiff
commit 45969485d67ecd5e6f5ad98e4c8a72a834378416
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
Reduce load in vdiff--scroll-function
Calling line-number-at-pos so many times was unnecessary and using a lot
of cpu
---
vdiff.el | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/vdiff.el b/vdiff.el
index d93ccb2..e8c9cff 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -733,16 +733,19 @@ buffer and center both buffers at this line."
(let* ((in-b (eq window win-b))
(other-window (if in-b win-a win-b))
(other-buffer (if in-b buf-a buf-b))
- (this-line (line-number-at-pos (point)))
- (other-line (vdiff--translate-line
- this-line in-b))
- (other-line-pos (vdiff--pos-at-line-beginning
- other-line other-buffer))
(this-start (line-number-at-pos window-start))
- (other-start (vdiff--translate-line
- this-start in-b))
- (other-start-pos (vdiff--pos-at-line-beginning
- other-start other-buffer))
+ (other-start (vdiff--translate-line this-start in-b))
+ (other-start-pos
+ (with-current-buffer other-buffer
+ (vdiff--move-to-line other-start)
+ (line-beginning-position)))
+ (this-line (+ (count-lines window-start (point))
+ this-start))
+ (other-line (vdiff--translate-line this-line in-b))
+ (other-line-pos
+ (with-current-buffer other-buffer
+ (forward-line (- other-line other-start))
+ (line-beginning-position)))
(vdiff--in-scroll-hook t))
(set-window-start other-window other-start-pos)
(set-window-point other-window other-line-pos)))))
- [elpa] scratch/add-vdiff e5d3633 226/258: Revert "vdiff-magit: Simplify stage", (continued)
- [elpa] scratch/add-vdiff e5d3633 226/258: Revert "vdiff-magit: Simplify stage", Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff de84cfd 232/258: vdiff-magit: Fix a function reference in dwim, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 7a3e456 234/258: vdiff-magit: Cleanup after stage, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 52d49ba 214/258: Merge branch 'magit' into magit2, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff ff1fbc4 248/258: vdiff: Generate ancestor buffer in merge-conflict, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff d243767 253/258: README: Add entry points and vimdiff bindings, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 79b3434 052/258: Make some arg names more consistent, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 528a5ce 051/258: Simplify logic for sending/receiving changes, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff c2f1ad9 068/258: Add vdiff-hydra.el, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff e94d187 059/258: Simplify adding overlays, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 4596948 081/258: Reduce load in vdiff--scroll-function,
Justin Burkett <=
- [elpa] scratch/add-vdiff d65fcd7 083/258: Simplify commentary, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 0777eda 099/258: Add vdiff-refresh binding to prefix map, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff d46f686 094/258: Make README table narrower, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 803fd6d 098/258: Add subtraction style option, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 5f2c72c 105/258: Change alignment algorithm, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f481a82 112/258: Add refresh timer delay, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 28d28b7 116/258: Add restore windows command, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 905be9c 122/258: Map remove refinements command, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 717d5b6 121/258: Allow failed line translation, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff b267885 137/258: Merge branch 'gvol-master', Justin Burkett, 2017/05/17