Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356319 - [editor] textMateStyler is missing a line caret style
Summary: [editor] textMateStyler is missing a line caret style
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Editor (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.4 M1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-31 08:50 EDT by Markus Albrecht CLA
Modified: 2011-12-01 17:00 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Albrecht CLA 2011-08-31 08:50:10 EDT
Build Identifier: Version 0.3M1

The syntax highlighting for Javascript, Java and CSS which is implemented by examples.textview.TextStyler in textStyles.js provides a style "line_caret" for highlighting the line of the caret.
It would be nice if the orion.editor.TextMateStyler (textMateStyler.js) would also support this feature to have consistent behavior for all text types.

Additionally it would be great to (optionally) show the line caret style not only in the text document but also in the ruler columns.


Reproducible: Always
Comment 1 Felipe Heidrich CLA 2011-10-27 15:08:49 EDT
(In reply to comment #0)
> Build Identifier: Version 0.3M1
> 
> The syntax highlighting for Javascript, Java and CSS which is implemented by
> examples.textview.TextStyler in textStyles.js provides a style "line_caret" for
> highlighting the line of the caret.
> It would be nice if the orion.editor.TextMateStyler (textMateStyler.js) would
> also support this feature to have consistent behavior for all text types.

IMO the we should move the caret line styler out of examples.textview.TextStyler so we can be consumed by the editor independently of the syntax highlight that is used. 
 
> Additionally it would be great to (optionally) show the line caret style not
> only in the text document but also in the ruler columns.

This is a different question, this should be easy to implement using annotation.
Comment 2 Silenio Quarti CLA 2011-11-16 17:15:48 EST
I am implementing this support in editor.js and making it a annotation so that it could show in the overview ruler.
Comment 3 Silenio Quarti CLA 2011-11-22 12:56:55 EST
Fixed
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=437ba88ca7edf7841f5deedb2037f9ded972927b

This patch includes fixes to somewhat unrelated problems we found while turning the caret line indicator into an annotation. The main problem is that the binary search done in annotation model cannot be used to find annotations that intersect with a given range because the annotation ranges can overlap.  For now, we are doing a linear search in those cases.  We will investigate interval search trees.
Comment 4 Silenio Quarti CLA 2011-11-22 13:04:15 EST
Mihai, note that we turn off the caret line indicator done by the sample text styler (textStyler.js).  We did not remove the support from the styler. You can still enable it by calling TextStyler.setHighlightCaretLine(true).  You might need this if you are not using editor.js.
Comment 5 Mihai Sucan CLA 2011-11-22 13:10:21 EST
(In reply to comment #4)
> Mihai, note that we turn off the caret line indicator done by the sample text
> styler (textStyler.js).  We did not remove the support from the styler. You can
> still enable it by calling TextStyler.setHighlightCaretLine(true).  You might
> need this if you are not using editor.js.

Thanks for your notification and especially thank you for not removing the code from the textStyler.js!

I still haven't added editor.js to our integration, because it seems the updating the existing code is sufficiently involved (wrt. regressions, test failures, etc). We still need more stabilization before we can move to the editor.js integration.