Replace highlight-indent-guides-mode with highlight-indentation

This commit is contained in:
Henrik Lissner 2017-03-25 03:15:37 -04:00
parent 3ce0e7d9c9
commit 5d597101e7
2 changed files with 7 additions and 10 deletions

View file

@ -111,15 +111,12 @@ disabled.")
(setq hs-hide-comments-when-hiding-all nil)) (setq hs-hide-comments-when-hiding-all nil))
;; Show uninterrupted indentation markers with some whitespace voodoo. ;; Show uninterrupted indentation markers with some whitespace voodoo.
(def-package! highlight-indent-guides (def-package! highlight-indentation
:commands highlight-indent-guides-mode :commands (highlight-indentation-mode highlight-indentation-current-column-mode)
:config :config
(setq highlight-indent-guides-method 'character)
;; FIXME highlight-indent-guides doesn't take advantage of injected whitespace
(defun doom|inject-trailing-whitespace (&optional start end) (defun doom|inject-trailing-whitespace (&optional start end)
"The opposite of `delete-trailing-whitespace'. Injects whitespace into "The opposite of `delete-trailing-whitespace'. Injects whitespace into
buffer so that `highlight-indent-guides-mode' will display uninterrupted indent buffer so that `highlight-indentation-mode' will display uninterrupted indent
markers. This whitespace is stripped out on save, as not to affect the resulting markers. This whitespace is stripped out on save, as not to affect the resulting
file." file."
(interactive (progn (barf-if-buffer-read-only) (interactive (progn (barf-if-buffer-read-only)
@ -132,7 +129,7 @@ file."
(let ((end-marker (copy-marker (or end (point-max)))) (let ((end-marker (copy-marker (or end (point-max))))
(start (or start (point-min)))) (start (or start (point-min))))
(goto-char start) (goto-char start)
(while (and (re-search-forward "^$" end-marker t) (not (>= (point) end-marker))) (while (and (re-search-forward "^$" end-marker t) (< (point) end-marker))
(let (line-start line-end next-start next-end) (let (line-start line-end next-start next-end)
(save-excursion (save-excursion
;; Check previous line indent ;; Check previous line indent
@ -154,8 +151,8 @@ file."
(set-buffer-modified-p nil)) (set-buffer-modified-p nil))
nil) nil)
(add-hook! 'highlight-indent-guides-mode-hook (add-hook! (highlight-indentation-mode highlight-indentation-current-column-mode)
(if highlight-indent-guides-mode (if highlight-indentation-mode
(progn (progn
(doom|inject-trailing-whitespace) (doom|inject-trailing-whitespace)
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t) (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)

View file

@ -12,7 +12,7 @@
(package! osx-clipboard)) (package! osx-clipboard))
;; core-ui.el ;; core-ui.el
(package! highlight-indent-guides) (package! highlight-indentation)
(package! highlight-numbers) (package! highlight-numbers)
(package! nlinum) (package! nlinum)
(package! rainbow-delimiters) (package! rainbow-delimiters)