sabof / project-explorer

A project explorer sidebar
267 stars 18 forks source link

[Feature Request] Highlight current buffer #22

Closed jimeh closed 9 years ago

jimeh commented 9 years ago

I'd like to have the file of the buffer that is currently active highlighted with a different color. And also when switching to another file, it would be nice if Project Explorer could at that point update the highlighted file, and even expand any directories if needed to highlight it.

katspaugh commented 9 years ago

@jimeh JFYI, to update the currently opened file, you can add this to your .emacs.d:

(defvar pe/update-timer nil)

(defun pe/update-other-window ()
  (when (pe/get-current-project-explorer-buffer)
    (let ((win (selected-window)))
      (project-explorer-open)
      (select-window win))))

(defun pe/update ()
  (interactive)
  (when pe/update-timer
    (cancel-timer pe/update-timer))
  (setq pe/update-timer (run-with-timer 0.1 nil #'pe/update-other-window)))

P.S. Sorry for spamming edits.

sabof commented 9 years ago

Feature implemented in #36