Skip to content
forked from ecb-home/ecb

Commit

Permalink
fix error non-semantic information was used to form speedbar tree
Browse files Browse the repository at this point in the history
  • Loading branch information
alexott committed Jun 12, 2012
1 parent b9d6374 commit d4ee1a6
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions ecb-speedbar.el
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -444,6 +444,14 @@ speedbar-window is not visible within the ECB-frame."
;; semantic-grammar available) but which can be parsed by imenu and/or etags ;; semantic-grammar available) but which can be parsed by imenu and/or etags
;; via speedbar. ;; via speedbar.


(defun ecb-speedbar-decorate-tag (tag face)
"Set given face to tag's text & return decorated text"
(let* ((txt-tmp (car tag))
(txt (when (stringp txt-tmp) (substring txt-tmp 0))))
(when txt
(set-text-properties 0 (length txt) `(face ,face) txt))
txt))

(defun ecb-speedbar-sb-tag-p (tag) (defun ecb-speedbar-sb-tag-p (tag)
"Return not nil if TAG is a semantic-tag generated from a speedbar tag." "Return not nil if TAG is a semantic-tag generated from a speedbar tag."
(ecb--semantic--tag-get-property tag 'ecb-speedbar-tag)) (ecb--semantic--tag-get-property tag 'ecb-speedbar-tag))
Expand Down Expand Up @@ -475,11 +483,7 @@ Return NODE."
(ecb--semantic--tag-put-property new-tag 'ecb-speedbar-tag t) (ecb--semantic--tag-put-property new-tag 'ecb-speedbar-tag t)
(ecb-apply-user-filter-to-tags (list new-tag)) (ecb-apply-user-filter-to-tags (list new-tag))
(when (not (ecb-tag-forbidden-display-p new-tag)) (when (not (ecb-tag-forbidden-display-p new-tag))
(tree-node-new (progn (tree-node-new (ecb-speedbar-decorate-tag tag ecb-method-non-semantic-face)
(set-text-properties
0 (length (car tag))
`(face ,ecb-method-non-semantic-face) (car tag))
(car tag))
0 0
new-tag new-tag
t t
Expand All @@ -495,11 +499,7 @@ Return NODE."
(when (not (ecb-tag-forbidden-display-p new-tag)) (when (not (ecb-tag-forbidden-display-p new-tag))
(ecb-create-non-semantic-tree (ecb-create-non-semantic-tree
(setq new-node (setq new-node
(tree-node-new (progn (tree-node-new (ecb-speedbar-decorate-tag tag ecb-method-non-semantic-face)
(set-text-properties
0 (length (car tag))
`(face ,ecb-method-non-semantic-face) (car tag))
(car tag))
0 0
new-tag new-tag
nil node)) nil node))
Expand All @@ -510,11 +510,7 @@ Return NODE."
(speedbar-generic-list-group (speedbar-generic-list-group
(ecb-create-non-semantic-tree (ecb-create-non-semantic-tree
(setq new-node (setq new-node
(tree-node-new (progn (tree-node-new (ecb-speedbar-decorate-tag tag ecb-method-non-semantic-face)
(set-text-properties
0 (length (car tag))
`(face ,ecb-method-non-semantic-face) (car tag))
(car tag))
1 1
nil nil node)) nil nil node))
(cdr tag)) (cdr tag))
Expand Down

0 comments on commit d4ee1a6

Please sign in to comment.