mirror of
				https://github.com/larstvei/Focus.git
				synced 2025-11-04 02:00:11 +00:00 
			
		
		
		
	Don't assume bounds are found
This commit is contained in:
		
							parent
							
								
									4846438e3f
								
							
						
					
					
						commit
						1423efbd25
					
				
							
								
								
									
										5
									
								
								focus.el
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								focus.el
									
									
									
									
									
								
							@ -167,8 +167,9 @@ deleted, and `focus-move-focus' is removed from `post-command-hook'."
 | 
				
			|||||||
  (interactive "p")
 | 
					  (interactive "p")
 | 
				
			||||||
  (forward-thing (focus-get-thing) (+ 1 n))
 | 
					  (forward-thing (focus-get-thing) (+ 1 n))
 | 
				
			||||||
  (let ((bounds (focus-bounds)))
 | 
					  (let ((bounds (focus-bounds)))
 | 
				
			||||||
    (goto-char (/ (+ (car bounds) (cdr bounds)) 2)))
 | 
					    (when bounds
 | 
				
			||||||
  (recenter nil))
 | 
					      (goto-char (/ (+ (car bounds) (cdr bounds)) 2))
 | 
				
			||||||
 | 
					      (recenter nil))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defun focus-prev-thing (&optional n)
 | 
					(defun focus-prev-thing (&optional n)
 | 
				
			||||||
  "Moves the point to the middle of the Nth previous thing."
 | 
					  "Moves the point to the middle of the Nth previous thing."
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user