From af05a0166796ab8411f046c4ae2a5a717710e7f8 Mon Sep 17 00:00:00 2001 From: Lars Tveito Date: Mon, 24 Feb 2020 21:50:24 +0100 Subject: [PATCH] Move condition --- focus.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/focus.el b/focus.el index 694131d..69819ac 100644 --- a/focus.el +++ b/focus.el @@ -173,13 +173,14 @@ The timer calls `focus-read-only-hide-cursor' after "Restore original colors between LOW and HIGH. Returns the list of added overlays." - (let* ((next (min high (or (next-property-change low) high))) - (face (get-text-property low 'face)) - (fg (focus-foreground-from-face face)) - (restored-face (focus-make-focused-face fg)) - (o (make-overlay low next))) - (overlay-put o 'face restored-face) - (cons o (when (< low high) (focus-undim-area next high))))) + (when (< low high) + (let* ((next (min high (or (next-property-change low) high))) + (face (get-text-property low 'face)) + (fg (focus-foreground-from-face face)) + (restored-face (focus-make-focused-face fg)) + (o (make-overlay low next))) + (overlay-put o 'face restored-face) + (cons o (focus-undim-area next high))))) (defun focus-move-focus () "Move the focused section according to `focus-bounds'.