This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+source-control/version-control/config.el
Miciah Masters ec0a535b27 Show conflicts in smerge ts hint
Use a dynamic hint for the smerge transient state in order to show the
current and total numbers of conflicts, and make the full hint toggleable.

* CHANGELOG.develop: Add an entry for this change.
* layers/+source-control/version-control/config.el
(spacemacs--smerge-ts-full-hint-toggle): New variable.
* layers/+source-control/version-control/funcs.el
(spacemacs//smerge-ts-hint): New function.  Return a string indicating the
index of the current conflict and the total number of conflicts detected by
smerge-mode.  If spacemacs--smerge-ts-full-hint-toggle is true, append the
smerge transient state's full hint.
(spacemacs//smerge-ts-toggle-hint): Toggle showing the full hint for the
smerge transient state.
* layers/+source-control/version-control/packages.el
(version-control/init-smerge-mode): Define the transient state in :init so
we can use spacemacs|transient-state-format-hint.  Use
spacemacs//smerge-ts-hint to display a dynamic hint.  Bind the ? key to
spacemacs//smerge-ts-toggle-hint.
2019-10-13 10:09:42 +02:00

82 lines
2.3 KiB
EmacsLisp

;;; config.el --- Version Control configuration File for Spacemacs
;;
;; Copyright (c) 2012-2018 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
(defvar spacemacs--smerge-ts-full-hint-toggle nil
"Display smerge transient-state documentation.")
(defvar version-control-global-margin t
"If non-nil, will show diff margins globally.")
(defvar version-control-diff-tool 'git-gutter+
"Options are `git-gutter', `git-gutter+', and `diff-hl' to show
version-control markers.")
(defvar version-control-diff-side 'right
"Side on which to show version-control markers.
Options are `left' and `right'.")
;; unchanged face
(defface git-gutter+-unchanged
'((t (:background "yellow")))
"face for unchanged lines"
:group 'git-gutter+)
(defface git-gutter:unchanged
'((t (:background "yellow")))
"face for unchanged lines"
:group 'git-gutter+)
;; change face
(defface git-gutter+-modified
'((t (:foreground "magenta" :weight bold)))
"face for modified lines"
:group 'git-gutter+)
(defface git-gutter:modified
'((t (:foreground "magenta" :weight bold)))
"face for modified lines"
:group 'git-gutter+)
(defface diff-hl-change
'((default :foreground "blue3")
(((class color) (min-colors 88) (background light))
:background "#ddddff")
(((class color) (min-colors 88) (background dark))
:background "#333355"))
"Face used to highlight changed lines."
:group 'diff-hl)
;; added face
(defface git-gutter+-added
'((t (:foreground "green" :weight bold)))
"face for added lines"
:group 'git-gutter+)
(defface git-gutter:added
'((t (:foreground "green" :weight bold)))
"face for added lines"
:group 'git-gutter+)
(defface diff-hl-insert
'((default :inherit diff-added)
(((class color)) :foreground "green4"))
"Face used to highlight inserted lines."
:group 'diff-hl)
;; deleted face
(defface git-gutter+-deleted
'((t (:foreground "red" :weight bold)))
"face for deleted lines"
:group 'git-gutter+)
(defface git-gutter:deleted
'((t (:foreground "red" :weight bold)))
"face for deleted lines"
:group 'git-gutter+)
(defface diff-hl-delete
'((default :inherit diff-removed)
(((class color)) :foreground "red3"))
"Face used to highlight deleted lines."
:group 'diff-hl)