branch: externals/vdiff commit 170e968c6a46a572b30c52c1b038232d418734cc Merge: d5df45f843 1e6e393104 Author: Justin Burkett <jus...@burkett.cc> Commit: GitHub <nore...@github.com>
Merge pull request #38 from wwade/master Fix diff opts handling (ignore case / whitespace) --- vdiff.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/vdiff.el b/vdiff.el index ac07e9c36b..33055eea2f 100644 --- a/vdiff.el +++ b/vdiff.el @@ -296,6 +296,10 @@ because those are handled differently.") "Make ARGS into list and remove nils." (delq nil (apply #'list args))) +(defun vdiff--maybe-list (str) + "Return a list with STR as the sole element, or an empty list if STR is empty." + (if (string= str "") '() (list str))) + (defun vdiff--buffer-a-p () (when (and vdiff--session @@ -489,7 +493,7 @@ non-nil. Ignore folds if NO-FOLD is non-nil." vdiff--case-options) vdiff--case-options)))) (setf (vdiff-session-case-args vdiff--session) - command-line-arg) + (vdiff--maybe-list command-line-arg)) (when vdiff-mode (vdiff-refresh))) @@ -502,7 +506,7 @@ non-nil. Ignore folds if NO-FOLD is non-nil." vdiff--whitespace-options) vdiff--whitespace-options)))) (setf (vdiff-session-whitespace-args vdiff--session) - command-line-arg) + (vdiff--maybe-list command-line-arg)) (when vdiff-mode (vdiff-refresh))) @@ -1901,8 +1905,8 @@ with non-nil USE-FOLDS." :process-buffer (generate-new-buffer-name " *vdiff* ") :word-diff-output-buffer (generate-new-buffer-name " *vdiff-word* ") :folds (make-hash-table :test 'equal :weakness 'value) - :case-args "" - :whitespace-args "" + :case-args nil + :whitespace-args nil :prior-window-config prior-window-config :on-quit on-quit :kill-buffers-on-quit kill-buffers-on-quit)) @@ -2359,7 +2363,7 @@ enabled automatically if `vdiff-lock-scrolling' is non-nil." "on (-i)")) (defun vdiff--current-whitespace () - (pcase (vdiff-session-whitespace-args vdiff--session) + (pcase (car (vdiff-session-whitespace-args vdiff--session)) ("" "off") ("-w" "all (-w)") ("-b" "space changes (-b)")