Files
.emacs.d/modules/editor/siren-whitespace.el
Jim Myhrberg 25b6493530 fix(completion/copilot): disable whitespace-mode to fix cursor placement issue
When whitespace-mode is enabled, single-line copilot completions makes
the cursor look like it's at the end of the completion rather than in
it's real position.

Issue with gifs showing the behavior is here:
https://github.com/zerolfx/copilot.el/issues/28

For the most part I should be able to live without whitespace-mode in
day to day use, and improvements to the highlight-indent-guides setup
should help.

And worst case, whitespace-mode can always be toggled easily enough.
2022-06-18 00:48:00 +01:00

42 lines
1.5 KiB
EmacsLisp

;;; siren-whitespace.el --- jimeh's Emacs Siren: whitespace configuration.
;;; Commentary:
;; Basic configuration for whitespace-mode.
;;; Code:
(use-package whitespace
:straight (:type built-in)
:diminish whitespace-mode global-whitespace-mode
:hook
(prog-mode . whitespace-cleanup-on-save-mode)
:preface
(define-minor-mode whitespace-cleanup-on-save-mode
"Run whitespace-cleanup on buffer save"
:global nil
(if whitespace-cleanup-on-save-mode
(add-hook 'before-save-hook 'whitespace-cleanup-on-save-cleanup)
(remove-hook 'before-save-hook 'whitespace-cleanup-on-save-cleanup)))
(defun whitespace-cleanup-on-save-cleanup()
(when (bound-and-true-p whitespace-cleanup-on-save-mode)
(whitespace-cleanup)))
:config
(setq whitespace-line-column 80
whitespace-style '(face tabs trailing space-before-tab newline
indentation space-after-tab tab-mark
newline-mark empty)
whitespace-display-mappings '((newline-mark ?\n
[?\u00AC ?\n] ;; \u00AC = ¬
[?$ ?\n])
(tab-mark ?\t
[?\u2192 ?\t] ;; \u2192 = →
[?\u00BB ?\t] ;; \u00BB = »
[?\\ ?\t]))))
(provide 'siren-whitespace)
;;; siren-whitespace.el ends here