;; 默认选中前一个tab
(defun awesome-tab-buffer-track-killed ()
"Hook run just before actually killing a buffer.
In Awesome-Tab mode, try to switch to a buffer in the current tab bar,
after the current buffer has been killed. Try first the buffer in tab
after the current one, then the buffer in tab before. On success, put
the sibling buffer in front of the buffer list, so it will be selected
first."
(and (eq header-line-format awesome-tab-header-line-format)
(eq awesome-tab-current-tabset-function 'awesome-tab-buffer-tabs)
(eq (current-buffer) (window-buffer (selected-window)))
(let ((bl (awesome-tab-tab-values (awesome-tab-current-tabset)))
(b (current-buffer))
found sibling)
(while (and bl (not found))
(if (eq b (car bl))
(setq found t)
(setq sibling (car bl)))
(setq bl (cdr bl)))
(when (and (setq sibling (or sibling (car bl) ));;改了这行
(buffer-live-p sibling))
;; Move sibling buffer in front of the buffer list.
(save-current-buffer
(switch-to-buffer sibling))))))
(defun chong-lisp-ui-header-line-height ()
(or (car (or (window-line-height 'header-line)
(and (redisplay t)
(window-line-height 'header-line)))) 0))
(defun lsp-ui-doc--mv-at-point (frame height start-x start-y)
"Move the FRAME at point.
HEIGHT is the child frame height.
START-X is the position x of the current window.
START-Y is the position y of the current window."
(-let* (((x . y) (--> (bounds-of-thing-at-point 'symbol)
(nth 2 (posn-at-point (car it)))))
(mode-line-y (lsp-ui-doc--line-height 'mode-line))
(char-height (frame-char-height))
(y (or (and (> y (/ mode-line-y 2))
(<= (- mode-line-y y) (+ char-height height))
(> (- y height) 0)
(- y height))
(+ y char-height))))
(set-frame-position frame (+ x start-x) (+ y start-y (chong-lisp-ui-header-line-height)))))