1
0
Fork 0

Fix typo, make annotations disappear when empties

This commit is contained in:
Tom Willemse 2019-04-09 14:05:09 -07:00
parent ffae62c08b
commit 63401d1ae7

View file

@ -25,12 +25,12 @@
;;; Code:
(defvar oni-chsarp--projects (make-hash-table :test 'equal))
(defvar oni-csharp--projects (make-hash-table :test 'equal))
(defun oni-chsarp-collect-project-names ()
(defun oni-csharp-collect-project-names ()
"Go through the current buffer and collect all the project names."
(interactive)
(clrhash oni-chsarp--projects)
(clrhash oni-csharp--projects)
(save-excursion
(goto-char (point-min))
(while (re-search-forward
@ -49,7 +49,7 @@
:noerror)
(puthash (match-string-no-properties 3)
(match-string-no-properties 2)
oni-chsarp--projects))))
oni-csharp--projects))))
(defun oni-csharp-display-project-names ()
"Display the project names in the current buffer."
@ -70,9 +70,10 @@
:noerror)
(let ((current-overlay (make-overlay (line-beginning-position) (line-end-position))))
(overlay-put current-overlay 'after-string
(propertize (format " => %s" (gethash (match-string 1) oni-chsarp--projects))
(propertize (format " => %s" (gethash (match-string 1) oni-csharp--projects))
'face '(:foreground "#808080")))
(overlay-put current-overlay 'oni-csharp--overlayp t)))))
(overlay-put current-overlay 'oni-csharp--overlayp t)
(overlay-put current-overlay 'evaporate t)))))
(provide 'oni-csharp)
;;; oni-csharp.el ends here