summaryrefslogtreecommitdiff
path: root/helm-semantic.el
diff options
context:
space:
mode:
authorTu Do <tu.h.do@dektech.com.au>2015-06-11 18:48:12 +0700
committerTu Do <tu.h.do@dektech.com.au>2015-06-11 18:48:12 +0700
commitc4723922360f609fc07df110eb2b6211b73d1a31 (patch)
treef9453568e46f85447baf02780ced6c49bccf069e /helm-semantic.el
parent19b6cf19e0aff29382b4040180f757c5b578bcc9 (diff)
[Fix #1053] Use proper way to detect when to update
Instead of using buffer-modified-tick, better let Semantic decides when it needs to update the parse tree using `semantic-parse-tree-needs-update-p`. It is better at detecting an outdated parse tree. When a user adds new text to a semantic tag i.e. add more code to a function, but does not delete/alter the function itself, Semantic won't reparse. But when the function name, or its arguments or its return type... anything attached to it being modified, then Semantic will update the parse tree.
Diffstat (limited to 'helm-semantic.el')
-rw-r--r--helm-semantic.el6
1 files changed, 2 insertions, 4 deletions
diff --git a/helm-semantic.el b/helm-semantic.el
index 93d98232..7fcdbee6 100644
--- a/helm-semantic.el
+++ b/helm-semantic.el
@@ -124,10 +124,8 @@ you have completion on these functions with `C-M i' in the customize interface."
(defun helm-semantic--maybe-set-needs-update ()
(with-helm-current-buffer
- (let ((tick (buffer-modified-tick)))
- (unless (eq helm-cached-imenu-tick tick)
- (setq helm-cached-imenu-tick tick)
- (semantic-parse-tree-set-needs-update)))))
+ (when (semantic-parse-tree-needs-update-p)
+ (semantic-parse-tree-set-needs-update))))
(defvar helm-source-semantic nil)