Hi All, Here is a basic example for doing a very simple syntax highlighted text editor: ===== styler := MyTextStyler new. browser := GLMTabulator new. browser row: #row. browser transmit to: #row; andShow: [ :composite | composite custom: (GLMRubricHighlightedTextPresentation new editingMode: [GLMHighlighterTextRubEditingMode withStylerDecorator: (GLMHighlighterTextStylerDecorator new styler: styler)]) ]. browser openOn: 'Some text with highlighting $@'. ===== Best regards, Ronie 2017-05-08 11:42 GMT-03:00 Offray Vladimir Luna Cárdenas < offray.luna@mutabit.com>:
Hi,
I would like something along the lines of the recent code syntax thread. Maybe something like:
===============
TextModel new isForCode: 'markdown'; text: (Collection>>#anyOne) sourceCode; aboutToStyle: true; openWithSpec
===============
This would do a great adding for Grafoscopio.
Cheers,
Offray
On 07/05/17 11:57, phil@highoctane.be wrote:
I want to do such an editor.
Preferrably something fast. And in the current Pharo.
There have been several text models, Rubric etc.
What is the quickest way to get such a thing?
Features:
Load/Save content Highlight keywords based on syntax parsing Act on the element under the cursor Act on the element when (modifier)clicking on it (or hovering). Fast (or at least, not sluggish on a "normal" (ie Core i5 1.8Ghz) laptop)
This is really something I miss being able to do in Pharo.
Lots of code is using "STHStyler" things but there seems to be no easy way to extend that (as it seems to be using the AST or something like that).
I am okay with a first easy approach to highlighting, like in Vim where one puts a syntax file with not that many things.
Phil