소스 검색

Fix

master
10sr 6 년 전
부모
커밋
f883b89509
로그인 계정: 10sr GPG 키 ID: 7BEC428194130EB2
1개의 변경된 파일24개의 추가작업 그리고 22개의 파일을 삭제
  1. +24
    -22
      emacs.el

+ 24
- 22
emacs.el 파일 보기

@@ -2193,32 +2193,34 @@ initializing."
(bname (format "Git Worktree<%s>" name)))
(with-current-buffer (get-buffer-create bname)
(cd root)
(let* ((trees (git-worktree-get-current-trees))
(branch-max-size
(apply 'max
(cl-loop for e in trees
when (plist-get e :branch)
collect (length (plist-get e :branch)))))
(worktree-max-size
(apply 'max
(cl-loop for e in trees
when (plist-get e :worktree)
collect (length (plist-get e :worktree)))))
)
(let ((trees (git-worktree-get-current-trees)))
(setq tabulated-list-entries
(mapcar (lambda (f)
(list f
(vector (or (plist-get f :branch) "")
(plist-get f :worktree)
(plist-get f :head))))
(mapcar (lambda (e)
(list e
(vector
(concat (file-relative-name (plist-get e :worktree))
"/")
(or (plist-get e :branch) "")
(plist-get e :head)
)))
trees))
(setq tabulated-list-format
`[("Branch" ,branch-max-size t)
("Worktree" ,worktree-max-size t)
("Head" -1 t)])
(let ((branch-max-size
(apply 'max
(cl-loop for e in tabulated-list-entries
collect (length (elt (cadr e) 1)))))
(worktree-max-size
(apply 'max
(length "Worktree")
(cl-loop for e in tabulated-list-entries
collect (length (elt (cadr e) 0))))))
(setq tabulated-list-format
`[
("Worktree" ,worktree-max-size t)
("Branch" ,branch-max-size t)
("Head" -1 t)
]))
(git-worktree-mode)
(current-buffer)))))

;; ((:worktree "/Users/10sr/.dotfiles" :head "5e7457a8d49ef6a517cdf39d038ba5fdf98dc68e" :branch "refs/heads/master") (:worktree "/Users/10sr/.dotfiles/b1" :head "fa7d868076d807692e35f82ae23596c903fd1117" :branch "refs/heads/b1"))
(defun git-worktree-open (&optional directory)
"Open git worktree list buffer.


불러오는 중...
취소
저장