-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(wrong-type-argument number-or-marker-p nil) after C-x 5 f ~/.emacs
#221
Comments
Hi @ema2159 ! would you have a clue of how to fix this bug? FWIW, the centaur-tabs-line-format code is as follows: (defun centaur-tabs-line-format (tabset)
"Return the `centaur-tabs-display-line-format' value to display TABSET."
(let* ((sel (centaur-tabs-selected-tab tabset))
(tabs (centaur-tabs-view tabset))
(padcolor centaur-tabs-background-color)
(all-tabs (centaur-tabs-tabs tabset))
(total-tabs (length all-tabs))
(sel-index (+ (cl-position (car sel) (cl-mapcar 'car all-tabs)) 1))
atsel elts)
;; Track the selected tab to ensure it is always visible.
(when centaur-tabs--track-selected
(while (not (memq sel tabs))
(centaur-tabs-scroll tabset -1)
(setq tabs (centaur-tabs-view tabset)))
(while (and tabs (not atsel))
(setq elts (cons (centaur-tabs-line-tab (car tabs)) elts)
atsel (eq (car tabs) sel)
tabs (cdr tabs)))
(setq elts (nreverse elts))
;; At this point the selected tab is the last elt in ELTS.
;; Scroll TABSET and ELTS until the selected tab becomes
;; visible.
(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.
(while tabs
(setq elts (cons (centaur-tabs-line-tab (car tabs)) elts)
tabs (cdr tabs)))
;; Cache and return the new tab bar.
(centaur-tabs-set-template
tabset
(list
(centaur-tabs-count sel-index total-tabs)
(centaur-tabs-line-format--buttons)
(nreverse elts)
(propertize "% "
'face (list :background padcolor)
'pointer 'arrow)
(centaur-tabs-line-format--new-button)))
)) and the (1st) error comes from the evaluation of |
Hi @ema2159 ! - just a friendly ping ^^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear @ema2159,
I recently spotted a subtle bug that I wasn't able to fix myself. See the details below. I use GNU Emacs 27.1 on Debian 11.
Steps to reproduce
The text was updated successfully, but these errors were encountered: