스플릿된 탭의 닫기 버튼을 누르면 다 닫혀버리길래




20줄도 안되는 존내 간단한 코드로 자연스러운 탭닫기 동작을 만들었음.

https://github.com/ema2159/centaur-tabs/pull/138

(defun centaur-tabs-do-close (event)
  "Given a mouse EVENT, close the tab at the mouse point."
  (interactive "e")
  (let ((window (posn-window (event-start event))))
    (with-selected-window window
      (select-window window)
      (let ((forground-buffer-name (buffer-name)))
        (centaur-tabs-buffer-select-tab `,(centaur-tabs-get-tab-from-event event))

        (let* ((buffer             (window-buffer window))
               (target-buffer-name (buffer-name))
               (same-target-check  (string-equal forground-buffer-name target-buffer-name))
               (window-num         (- (length (get-buffer-window-list buffer))
                                      (if same-target-check 0 1))))
          (if (> window-num 1)
              (delete-window window)
            (centaur-tabs-buffer-close-tab `,(centaur-tabs-get-tab-from-event event))))))))


메인테이너가 바빠서 좀 느린 것 같은데,

설정파일에 함수 복붙해서 넣으면 재정의되서 써볼 수 있음.