         (when danylo/highlight-timer
           (cancel-timer danylo/highlight-timer)
           (setq danylo/highlight-timer nil)
-          (let ((rol (window-parameter window 'internal-region-overlay)))
-            (funcall redisplay-unhighlight-region-function rol))
+          (run-with-timer
+           0.02 nil
+           (lambda (window)
+             (let ((rol (window-parameter window 'internal-region-overlay)))
+               (funcall redisplay-unhighlight-region-function rol))) window)
           )
       (unless danylo/highlight-timer
         (danylo/highlight-region-low-level window) ;; Immediate highlight once

(setq show-paren-delay `,danylo/fontify-delay)
(show-paren-mode 1)

(use-package solaire-mode
  ;; https://github.com/hlissner/emacs-solaire-mode
  ;; Distinguish file-visiting buffers with slightly different background

(use-package doom-themes
  ;; https://github.com/hlissner/emacs-doom-themes
  ;; An opinionated pack of modern color-themes
  :ensure nil
  :quelpa ((doom-themes :fetcher github
                        :repo "hlissner/emacs-doom-themes"
                        :commit "b2c0ea0"
                        :files (:defaults "themes")))
  :config
  (load-theme 'doom-one t)
  (set-face-attribute 'region nil
