[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/add-vdiff 81478be 117/258: Lock diff data for certain ope
From: |
Justin Burkett |
Subject: |
[elpa] scratch/add-vdiff 81478be 117/258: Lock diff data for certain operations |
Date: |
Wed, 17 May 2017 08:13:35 -0400 (EDT) |
branch: scratch/add-vdiff
commit 81478be38e7566a153b088cd3c8b2325ce35ff0b
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
Lock diff data for certain operations
---
vdiff.el | 56 +++++++++++++++++++++++++++++---------------------------
1 file changed, 29 insertions(+), 27 deletions(-)
diff --git a/vdiff.el b/vdiff.el
index 41897a5..80d3369 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -172,6 +172,7 @@ because those are handled differently.")
(defvar vdiff--diff-code-regexp
"^\\([0-9]+\\),?\\([0-9]+\\)?\\([adc]\\)\\([0-9]+\\),?\\([0-9]+\\)?")
(defvar vdiff--inhibit-window-switch nil)
+(defvar vdiff--inhibit-diff-data-update nil)
(defvar vdiff--in-scroll-hook nil)
;; (defvar vdiff--in-post-command-hook nil)
(defvar vdiff--a-b-line-map nil)
@@ -318,32 +319,31 @@ because those are handled differently.")
(defun vdiff--diff-refresh-1 (proc event)
"This is the sentinel for `vdiff-refresh'. It does the job of
parsing the diff output and triggering the overlay updates."
- (cond ((string= "finished\n" event)
- ;; means no difference between files
- (setq vdiff--diff-data nil)
- (vdiff--refresh-overlays)
- (vdiff--refresh-line-maps))
- ((string= "exited abnormally with code 1\n" event)
- (setq vdiff--diff-data nil)
- (let (res)
- (with-current-buffer (process-buffer proc)
- (goto-char (point-min))
- (while (re-search-forward vdiff--diff-code-regexp nil t)
- (let* ((code (match-string 3))
- (a-range (vdiff--normalize-range
- code t (match-string 1) (match-string 2)))
- (b-range (vdiff--normalize-range
- code nil (match-string 4) (match-string 5))))
- (push (list code a-range b-range) res))))
- (setq vdiff--diff-data (nreverse res)))
- (vdiff--refresh-overlays)
- (vdiff--refresh-line-maps))
- ((string-match-p "exited abnormally with code" event)
- (setq vdiff--diff-data nil)
- (vdiff--refresh-overlays)
- (vdiff--refresh-line-maps)
- (message "vdiff process error: %s" event)))
- (setq vdiff--diff-stale nil))
+ (unless vdiff--inhibit-diff-data-update
+ (setq vdiff--diff-data nil)
+ (cond ((string= "finished\n" event)
+ ;; means no difference between files
+ (vdiff--refresh-overlays)
+ (vdiff--refresh-line-maps))
+ ((string= "exited abnormally with code 1\n" event)
+ (let (res)
+ (with-current-buffer (process-buffer proc)
+ (goto-char (point-min))
+ (while (re-search-forward vdiff--diff-code-regexp nil t)
+ (let* ((code (match-string 3))
+ (a-range (vdiff--normalize-range
+ code t (match-string 1) (match-string 2)))
+ (b-range (vdiff--normalize-range
+ code nil (match-string 4) (match-string 5))))
+ (push (list code a-range b-range) res))))
+ (setq vdiff--diff-data (nreverse res)))
+ (vdiff--refresh-overlays)
+ (vdiff--refresh-line-maps))
+ ((string-match-p "exited abnormally with code" event)
+ (vdiff--refresh-overlays)
+ (vdiff--refresh-line-maps)
+ (message "vdiff process error: %s" event)))
+ (setq vdiff--diff-stale nil)))
(defun vdiff--remove-all-overlays ()
"Remove all vdiff overlays in both vdiff buffers."
@@ -704,6 +704,7 @@ of a \"word\"."
(b-line 1)
(a-last-post 1)
(b-last-post 1)
+ (vdiff--inhibit-diff-data-update t)
folds)
(save-excursion
(with-current-buffer a-buffer
@@ -858,7 +859,8 @@ just deleting text in the other buffer."
(defun vdiff--refresh-line-maps ()
"Sync information in `vdiff--line-map' with
`vdiff--diff-data'."
- (let (a-b-map b-a-map)
+ (let ((vdiff--inhibit-diff-data-update t)
+ a-b-map b-a-map)
(dolist (entry vdiff--diff-data)
(let* ((code (car entry))
(a-lines (nth 1 entry))
- [elpa] scratch/add-vdiff 9b3ffb0 150/258: Don't distiguish exit code 0 from 1, (continued)
- [elpa] scratch/add-vdiff 9b3ffb0 150/258: Don't distiguish exit code 0 from 1, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff d33845c 167/258: Minor change in cleanup, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff edfae89 176/258: Cleanup vdiff-buffers, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 85a4d4e 087/258: Fix point jumping after sending changes, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f041c58 102/258: Sync lines after sending changes, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 88ce867 088/258: Initial attempt at refine commands, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f3ca6cb 110/258: Tweak vscroll function, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 84380fb 113/258: Delete unused lexical vars, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 40351c6 079/258: Exit hydra on vdiff exit, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 4bb84e4 073/258: Add update command to hydra, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 81478be 117/258: Lock diff data for certain operations,
Justin Burkett <=
- [elpa] scratch/add-vdiff 20bd4b4 092/258: Change terminology, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 3d8e224 127/258: Simplify insertion arrow code, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff bd80900 126/258: Merge pull request #7 from syohex/fix-package, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 1102da8 129/258: Avoid subtraction overlays larger than window-height, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 7135738 132/258: Version 0.1, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 2e7f076 141/258: Simplify bitmap creation, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 001ae43 152/258: Fix modification of buffer list, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 477eb88 161/258: Fix refinement bug, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f1eca80 165/258: Disable refine-all-hunks for diff3, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 30b85fe 164/258: Fix sending changes with diff3, Justin Burkett, 2017/05/17