File tree Expand file tree Collapse file tree 5 files changed +51
-1
lines changed
Expand file tree Collapse file tree 5 files changed +51
-1
lines changed Original file line number Diff line number Diff line change 3535 - name : Run tests
3636 run : |
3737 eask install-deps
38+
39+ eask test buttercup
40+
3841 eask package
3942 eask install
4043 eask compile
Original file line number Diff line number Diff line change 33dist
44.eask
55* .elc
6+ * ~
Original file line number Diff line number Diff line change 1+ # Changelog
2+
3+ ## Unreleased
4+
5+ - Fix issue with ` view_ediff ` displaying empty buffers in ediff. #86
Original file line number Diff line number Diff line change @@ -51,7 +51,9 @@ ROOTS may be passed for path relativization if desired.
5151
5252This function tries to be Doom-compatible when Emacs runs Doom popup
5353system (it ignores those popup rules for the generated ediff buffers)."
54- (let* ((parsed (eca-diff-parse-unified-diff diff))
54+ (let* (; ; ediff expects `\n` line endings.
55+ (diff (replace-regexp-in-string " \r\n " " \n " diff))
56+ (parsed (eca-diff-parse-unified-diff diff))
5557 (orig (plist-get parsed :original ))
5658 (new (plist-get parsed :new ))
5759 (buf-orig (generate-new-buffer (format " *eca-diff-orig:%s * " path)))
Original file line number Diff line number Diff line change 1+ ; ;; -*- lexical-binding : t ; -*-
2+ (require 'buttercup )
3+ (require 'eca-diff )
4+
5+ (defconst native-eol
6+ (if (eq system-type 'windows-nt )
7+ " \r\n "
8+ " \n " )
9+ " Native end-of-line string for the current operating system." )
10+
11+ (describe " eca-diff-show-ediff"
12+ :var ((insert-orig (symbol-function 'insert ))
13+ (contents '()))
14+ (before-each
15+ (spy-on 'insert
16+ :and-call-fake (lambda (&rest args )
17+ (apply insert-orig args)
18+ (push (list (buffer-name ) (buffer-string )) contents )
19+ )))
20+ (it " can display unified diffs with native EOLs"
21+ (let* ((inhibit-message t )
22+ (path " /a/path" )
23+ (diff (string-join '(" @@ -1,3 +1,4 @@"
24+ " -Line 1"
25+ " -Line 2"
26+ " +Line 1 modified"
27+ " +Line 2"
28+ " +Line 3 added" )
29+ native-eol)))
30+
31+ ; ; We expect this function to call `insert` twice.
32+ (eca-diff-show-ediff path diff)
33+ (expect (reverse contents)
34+ :to-equal
35+ `((,(format " *eca-diff-orig:%s * " path) " Line 1
36+ Line 2" )
37+ (,(format " *eca-diff-new:%s * " path) " Line 1 modified
38+ Line 2
39+ Line 3 added" ))))))
You can’t perform that action at this time.
0 commit comments