spacemacs/layers/+source-control/git/funcs.el

37 lines
1.1 KiB
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; funcs.el --- Colors Layer functions File
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; magit
(defun spacemacs/magit-toggle-whitespace ()
"Toggle whitespace in `magit-diff-mode'."
(interactive)
(if (member "-w" (if (derived-mode-p 'magit-diff-mode)
magit-refresh-args
magit-diff-section-arguments))
(spacemacs//magit-dont-ignore-whitespace)
(spacemacs//magit-ignore-whitespace)))
(defun spacemacs//magit-ignore-whitespace ()
"Ignore whitespace in `magit-diff-mode'"
(add-to-list (if (derived-mode-p 'magit-diff-mode)
'magit-refresh-args 'magit-diff-section-arguments) "-w")
(magit-refresh))
(defun spacemacs//magit-dont-ignore-whitespace ()
"Don't ignore whitespace in `magit-diff-mode'"
(setq magit-diff-options
(remove "-w"
(if (derived-mode-p 'magit-diff-mode)
magit-refresh-args
magit-diff-section-arguments))) (magit-refresh))