New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a bug in helm-semantic #777
Conversation
Currently, helm-semantic-source inserts tag candidates in its own buffer. This causes a problem: semantic-format-tag-summarize adds pointer information with characters like * and &, specific to C and C++ modes. However, since the function is called in helm buffer created by (helm-candidate-buffer 'global), it is in fundamental-mode and cannot insert tag string correctly. Pointer information with characters * and & is stripped. To reproduce this bug: - Create an empty C or C++ file and insert only this line: const char**** filename; Then, run helm-semantic. The candidate is displayed as: const char filename; This change fixes this problem by setting the Helm buffer to the actual major mode of the current code buffer. The function helm-semantic-get-candidates because it calls helm-semantic--fetch-candidates again, after being called once the initform in helm-source-semantic.
You can read more about this issue on StackExchange. |
Tu Do notifications@github.com writes:
Can you try this patch instead, looks simpler: diff --git a/helm-semantic.el b/helm-semantic.el -(defun helm-semantic-get-candidates ()
- (buffer-string)) "\n"))(defun helm-semantic--maybe-set-needs-update () (defvar helm-source-semantic nil) -(defclass helm-semantic-source (helm-source-sync)
Thierry |
It won't work because |
Tu Do notifications@github.com writes:
You have to delete the old helm-semantic buffer, revert buffer, reload Thierry |
* helm-semantic.el (helm-semantic-source): Use helm-source-in-buffer. (helm-semantic-get-candidates): Removed.
Your patch works fine now. I got an error because I had to apply it manually, since the patch is malformed when I copied it into my buffer. You can merge your fix. |
I have pushed to exp branch, just install it and try, you will see it Thanks. Thierry |
Yes, it works fine. |
I consider this is merged. Thanks. |
Tu Do notifications@github.com writes:
Use
Done, thanks. Thierry |
Currently, helm-semantic-source inserts tag candidates in its own
buffer. This causes a problem: semantic-format-tag-summarize adds
pointer information with characters like * and &, specific to C and C++
modes. However, since the function is called in helm buffer created
by (helm-candidate-buffer 'global), it is in fundamental-mode and cannot
insert tag string correctly. Pointer information with characters * and &
is stripped. To reproduce this bug:
const char**** filename;
Then, run helm-semantic. The candidate is displayed as:
const char filename;
This change fixes this problem by setting the Helm buffer to the actual
major mode of the current code buffer. The function
helm-semantic-get-candidates because it calls
helm-semantic--fetch-candidates again, after being called once the
initform in helm-source-semantic.