diff --git a/oni-csharp/oni-csharp.el b/oni-csharp/oni-csharp.el index 02b1cd7..1eb20a4 100644 --- a/oni-csharp/oni-csharp.el +++ b/oni-csharp/oni-csharp.el @@ -186,24 +186,34 @@ _cs_: Solution (interactive) (save-excursion (goto-char (point-min)) - (remove-overlays (point-min) (point-max) 'oni-csharp--overlayp t) (while (re-search-forward (rx bol (zero-or-more whitespace) - "{" - (group (minimal-match (one-or-more (or alphanumeric "-")))) - "} = {" - (group (minimal-match (one-or-more (or alphanumeric "-")))) - "}" + (group + "{" + (group (minimal-match (one-or-more (or alphanumeric "-")))) + "}") + " = " + (group + "{" + (group (minimal-match (one-or-more (or alphanumeric "-")))) + "}") eol) nil :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-csharp--projects)) - 'face '(:foreground "#808080"))) - (overlay-put current-overlay 'oni-csharp--overlayp t) - (overlay-put current-overlay 'evaporate t))))) + (add-text-properties + (match-beginning 1) (match-end 1) + (list 'display (gethash (match-string 2) oni-csharp--projects) + 'face 'font-lock-variable-name-face + 'help-echo (buffer-substring-no-properties + (match-beginning 1) (match-end 1)) + 'intangile nil)) + (add-text-properties + (match-beginning 3) (match-end 3) + (list 'display (gethash (match-string 4) oni-csharp--projects) + 'face 'font-lock-variable-name-face + 'help-echo (buffer-substring-no-properties + (match-beginning 3) (match-end 3))))))) (define-derived-mode csharp-solution-mode prog-mode "Sln" "A major mode for viewing and editing C# ‘.sln’ files."