mirror of
				https://github.com/larstvei/Focus.git
				synced 2025-11-04 02:00:11 +00:00 
			
		
		
		
	Fix #5
This commit is contained in:
		
							parent
							
								
									b90cfb3c27
								
							
						
					
					
						commit
						307df45c69
					
				
							
								
								
									
										7
									
								
								focus.el
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								focus.el
									
									
									
									
									
								
							@ -166,10 +166,11 @@ adds `focus-move-focus' to `post-command-hook'."
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
The overlays pointed to by `focus-pre-overlay' and `focus-post-overlay' are
 | 
					The overlays pointed to by `focus-pre-overlay' and `focus-post-overlay' are
 | 
				
			||||||
deleted, and `focus-move-focus' is removed from `post-command-hook'."
 | 
					deleted, and `focus-move-focus' is removed from `post-command-hook'."
 | 
				
			||||||
 | 
					  (when (and focus-pre-overlay focus-post-overlay)
 | 
				
			||||||
    (mapc 'delete-overlay (list focus-pre-overlay focus-post-overlay))
 | 
					    (mapc 'delete-overlay (list focus-pre-overlay focus-post-overlay))
 | 
				
			||||||
    (remove-hook 'post-command-hook 'focus-move-focus t)
 | 
					    (remove-hook 'post-command-hook 'focus-move-focus t)
 | 
				
			||||||
    (setq focus-pre-overlay  nil
 | 
					    (setq focus-pre-overlay  nil
 | 
				
			||||||
        focus-post-overlay nil))
 | 
					          focus-post-overlay nil)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defun focus-goto-thing (bounds)
 | 
					(defun focus-goto-thing (bounds)
 | 
				
			||||||
  "Move point to the middle of BOUNDS."
 | 
					  "Move point to the middle of BOUNDS."
 | 
				
			||||||
@ -261,6 +262,10 @@ up the `focus-read-only-blink-timer' and hooks."
 | 
				
			|||||||
  :keymap (let ((map (make-sparse-keymap)))
 | 
					  :keymap (let ((map (make-sparse-keymap)))
 | 
				
			||||||
            (define-key map (kbd "C-c C-q") 'focus-read-only-mode)
 | 
					            (define-key map (kbd "C-c C-q") 'focus-read-only-mode)
 | 
				
			||||||
            map)
 | 
					            map)
 | 
				
			||||||
 | 
					  (unless (and (color-defined-p (face-attribute 'default :background))
 | 
				
			||||||
 | 
					               (color-defined-p (face-attribute 'default :foreground)))
 | 
				
			||||||
 | 
					    (message "Can't enable focus mode when no theme is loaded.")
 | 
				
			||||||
 | 
					    (setq focus-mode nil))
 | 
				
			||||||
  (if focus-mode (focus-init) (focus-terminate)))
 | 
					  (if focus-mode (focus-init) (focus-terminate)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;;###autoload
 | 
					;;;###autoload
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user