Skip to content

Commit

Permalink
Fix: Flickering and performance issues. Fixes #88, Fixes #18
Browse files Browse the repository at this point in the history
  • Loading branch information
ema2159 committed Mar 1, 2020
1 parent 96b7c90 commit c3254ef
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions centaur-tabs.el
Original file line number Diff line number Diff line change
Expand Up @@ -924,23 +924,24 @@ element."
;; At this point the selected tab is the last elt in ELTS.
;; Scroll TABSET and ELTS until the selected tab becomes
;; visible.
(with-temp-buffer
(let ((truncate-partial-width-windows nil)
(inhibit-modification-hooks t)
deactivate-mark ;; Prevent deactivation of the mark!
start)
(setq truncate-lines nil
buffer-undo-list t)
(setq start (point))
(while (and (cdr elts) ;; Always show the selected tab!
(progn
(delete-region start (point-max))
(goto-char (point-max))
(apply #'insert elts)
(goto-char (point-min))
(> (vertical-motion 1) 0)))
(centaur-tabs-scroll tabset 1)
(setq elts (cdr elts)))))
(let (buffer-list-update-hook)
(with-temp-buffer
(let ((truncate-partial-width-windows nil)
(inhibit-modification-hooks t)
deactivate-mark ;; Prevent deactivation of the mark!
start)
(setq truncate-lines nil
buffer-undo-list t)
(setq start (point))
(while (and (cdr elts) ;; Always show the selected tab!
(progn
(delete-region start (point-max))
(goto-char (point-max))
(apply #'insert elts)
(goto-char (point-min))
(> (vertical-motion 1) 0)))
(centaur-tabs-scroll tabset 1)
(setq elts (cdr elts))))))
(setq elts (nreverse elts))
(setq centaur-tabs--track-selected nil))
;; Format remaining tabs.
Expand Down

0 comments on commit c3254ef

Please sign in to comment.