Closed futurist closed 7 years ago
This is not normal, no. What major mode and minor modes are you running?
Please see below:
Enabled minor modes: Annotate Anzu Auto-Composition Auto-Compression
Auto-Encryption Blink-Cursor Bug-Reference-Prog Column-Number Company
Company-Flx Cursor-Sensor Delete-Selection Desktop-Save
Diff-Auto-Refine Diff-Hl Editorconfig Electric-Indent Electric-Pair
File-Name-Shadow Font-Lock Form-Feed Global-Anzu Global-Auto-Revert
Global-Company Global-Eldoc Global-Font-Lock Global-Page-Break-Lines
Global-Prettify-Symbols Global-Undo-Tree Global-Whitespace-Cleanup
Goto-Address-Prog Guide-Key Hes Highlight-Symbol Highlight-Symbol-Nav
Ido-Everywhere Ido-Ubiquitous Js2-Refactor Line-Number Mouse-Wheel
Override-Global Paredit-Everywhere Rainbow-Delimiters Recentf
Save-Place Savehist Shell-Dirtrack Show-Paren Tern Tooltip
Transient-Mark Undo-Tree Whitespace-Cleanup Whole-Line-Or-Region
Winner Yas Yas-Global
(Information about these minor modes follows the major mode info.)
JS2 mode defined in ‘js2-mode.el’:
Major mode for editing JavaScript code.
I can't reproduce your problem on my machine. Does annotate-mode work for other files? I suspect that some minor mode is overwriting or suppressing the display property. Can you try disabling your minor modes one by one (and then possibly reloading the file) to see if any of those is the problem?
After tried close below modes, (from bottom to top), the annotation appeared.
(annotate-mode (quote toggle))
(annotate-mode (quote toggle))
(override-global-mode (quote toggle))
(describe-mode)
(annotate-mode (quote toggle))
(annotate-mode (quote toggle))
(global-eldoc-mode (quote toggle))
(describe-mode)
(annotate-mode (quote toggle))
(annotate-mode (quote toggle))
(highlight-symbol-mode (quote toggle))
(describe-mode)
(switch-to-buffer "*Messages*")
(annotate-mode (quote toggle))
(annotate-mode (quote toggle))
(yas-global-mode (quote toggle))
(describe-mode)
(annotate-mode (quote toggle))
(annotate-mode (quote toggle))
(eldoc-mode (quote toggle))
(annotate-mode (quote toggle))
Also this mode don't support CJK char? I'm tried Chinese, the message is below:
Error during redisplay: (jit-lock-function 5491) signaled (args-out-of-range "oijsdofj认说的的这的" 0 20)
Or maybe the problem is the lib itself? I'm tried a new restart, and only annotate on one char (not the whole 3 lines), the annotate appeared. (same minor mode and major mode as above)
Thank you very much for your analysis.
Unicode used to be a problem, although I thought I fixed those issues. But I can confirm that annotations don't work with the above Chinese string.
I would guess that there is an inconsistency between string handling between string-width
and substring
with Unicode strings, which trips up annotate's text layout.
I don't think I have time to look into this in the next few weeks, but I'll see what I can do. In the meantime, if you want to take a stab at this problem, it is most likely to be found in annotate--annotation-builder
and annotate-lineate
.
OK, I just committed a fix
Can you verify that this fixes your issue?
Thank you for the quick response!
I've tried the Chinese char work right!
But the whole line annotation cannot show.
Take it easy! The work around is avoid using whole line annotation... Maybe it's not easy to track on your side... And I will try to fix it when I have spare time maybe...
I can't reproduce that one. Can you send me an example file and an example annotation?
OK, this helped. I believe I found and fixed the problem, now. Can you verify that it is indeed fixed?
I also fixed another problem, where annotations were shown at an incorrect column if the line contained tabs. Of course I never found these since I don't use tabs. This was very educational.
Thank you! it's now worked. But can the annotation position adjusted by user? see the problem:
Above, you cannot easily distinguish which annotation belongs to which block....
The problem is, the annotation includes the final newline, and therefore technically includes the next line. And it always shows up on the last line of the annotation.
I was meaning to provide a setting for customizing the position of the annotation for a while now. It will happen at some point, but it will require some re-architecting of annotate.el and will probably take a while. This would also allow you to put annotations above or below the highlights.
See my screenshot, is it normal?