diff options
| author | Basil L. Contovounesios <contovob@tcd.ie> | 2017-12-10 14:34:47 +0000 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2017-12-10 16:59:38 +0100 |
| commit | a048292ac99e4aa44ba75e810fa07968a2555d97 (patch) | |
| tree | ba133c2a0cd132794632de3e2f1e79e39fe84732 /lisp | |
| parent | 0b511ca0cc0464a3ec374c3a2877b33b2f280d10 (diff) | |
magit-diff-tab-width: Fix cond guard
The value of recent defcustom magit-diff-adjust-tab-width can be
either a symbol or a number, so check before performing arithmetic
operations on it.
Do not use file-attribute-size accessor added in Emacs 26.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/magit-diff.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index 3015df8..9cf7597 100644 --- a/lisp/magit-diff.el +++ b/lisp/magit-diff.el @@ -2453,8 +2453,9 @@ are highlighted." (or (cdr it) tab-width))) ((or (eq magit-diff-adjust-tab-width 'always) - (>= magit-diff-adjust-tab-width - (file-attribute-size (file-attributes file)))) + (and (numberp magit-diff-adjust-tab-width) + (>= magit-diff-adjust-tab-width + (nth 7 (file-attributes file))))) (with-current-buffer (setq buf (find-file-noselect file)) (cache tab-width))) (t |
