Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix error non-semantic information was used to form speedbar tree

  • Loading branch information...
commit d4ee1a64cdc3b129f63917bca214407433c03110 1 parent b9d6374
@alexott authored
Showing with 11 additions and 15 deletions.
  1. +11 −15 ecb-speedbar.el
View
26 ecb-speedbar.el
@@ -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
;; 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)
"Return not nil if TAG is a semantic-tag generated from a speedbar tag."
(ecb--semantic--tag-get-property tag 'ecb-speedbar-tag))
@@ -475,11 +483,7 @@ Return NODE."
(ecb--semantic--tag-put-property new-tag 'ecb-speedbar-tag t)
(ecb-apply-user-filter-to-tags (list new-tag))
(when (not (ecb-tag-forbidden-display-p new-tag))
- (tree-node-new (progn
- (set-text-properties
- 0 (length (car tag))
- `(face ,ecb-method-non-semantic-face) (car tag))
- (car tag))
+ (tree-node-new (ecb-speedbar-decorate-tag tag ecb-method-non-semantic-face)
0
new-tag
t
@@ -495,11 +499,7 @@ Return NODE."
(when (not (ecb-tag-forbidden-display-p new-tag))
(ecb-create-non-semantic-tree
(setq new-node
- (tree-node-new (progn
- (set-text-properties
- 0 (length (car tag))
- `(face ,ecb-method-non-semantic-face) (car tag))
- (car tag))
+ (tree-node-new (ecb-speedbar-decorate-tag tag ecb-method-non-semantic-face)
0
new-tag
nil node))
@@ -510,11 +510,7 @@ Return NODE."
(speedbar-generic-list-group
(ecb-create-non-semantic-tree
(setq new-node
- (tree-node-new (progn
- (set-text-properties
- 0 (length (car tag))
- `(face ,ecb-method-non-semantic-face) (car tag))
- (car tag))
+ (tree-node-new (ecb-speedbar-decorate-tag tag ecb-method-non-semantic-face)
1
nil nil node))
(cdr tag))

0 comments on commit d4ee1a6

Please sign in to comment.
Something went wrong with that request. Please try again.