ema2159 / centaur-tabs

Emacs plugin aiming to become an aesthetic, modern looking tabs plugin
GNU General Public License v3.0
743 stars 51 forks source link

Ace labels do not work with more than 9 visible tabs #231

Closed gpanago closed 3 months ago

gpanago commented 5 months ago

Steps to reproduce:

  1. Have more than 9 buffers in a group.
  2. Make sure that centaur tabs is showing more than 9 buffers on the tab-line (easiest with 1 window split and wide screens/small fonts/small buffer names).
  3. Trigger ace labels (e.g. by calling centaur-tabs-ace-jump).

You get the following errors:

Error during redisplay: (eval (centaur-tabs-line)) signaled (error "Format specifier doesn’t match argument type")

The problem is in centaur-tabs-line-tab and specifically the line:

(format "%c" (nth (cl-position tab (centaur-tabs-view (centaur-tabs-current-tabset t))) centaur-tabs-ace-jump-keys))

as centaur-tabs-ace-jump-keys is only 9 in length.

gpanago commented 5 months ago

Hacky workaround:

(setq centaur-tabs-ace-jump-keys (append '(?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9) (make-list 100 ?\ )))

jeff-phil commented 5 months ago

Better to use characters, then you can ace-jump to numbers or letters or punctuation:

    (setq centaur-tabs-ace-jump-keys '( ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?a ?b ?c ?d ?e ?f
                                        ?g ?h ?i ?k ?l ?m ?n ?o ?p ?q ?r ?t ?u ?v ?w
                                        ?x ?y ?z ?! ?@ ?# ?$ ?% ?^ ?& ?*))