Editor with syntax highlighting awareness
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
Phil, It is something that I want too in Pharo. Especially for rendering Markdown / Pillar. I'm willing to help if you need a hand. Don't expect a pro developer but I will do my best. Let me know. Best Nacho ----- Nacho Smalltalker apprentice. Buenos Aires, Argentina. -- View this message in context: http://forum.world.st/Editor-with-syntax-highlighting-awareness-tp4945812p49... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Dolphin Smalltalk has such an editor - so it might provide inspiration for you. It uses the scintilla library which I notice does support windows/osx/linux ( http://www.scintilla.org/ScintillaDownload.html <http://www.scintilla.org/ScintillaDownload.html> ) but it might be more than what you need given Pharo has over the years added many things that get it close (just not the colour coding) Tim
On 7 May 2017, at 17: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
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
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
participants (5)
-
nacho -
Offray Vladimir Luna Cárdenas -
phil@highoctane.be -
Ronie Salgado -
Tim Mackinnon