keenwrite icon indicating copy to clipboard operation
keenwrite copied to clipboard

Apply syntax highlighting for source document types

Open DaveJarvis opened this issue 4 years ago • 0 comments

Add a stylesheet that applies syntax highlighting to the editor whilst editing text-based documents. Currently there is a MarkdownEditorPane, which is instantiated by each FileEditorTab. This would have to be made generic with respect to a particular editor type. Examples: EditorPane<Markdown> and EditorPane<AsciiDoc>.

The key line for highlighting would resemble:

textArea.getStylesheets().add( STYLESHEET_MARKDOWN );

See MarkdownEditorPane::initEditor for details.


There has been interest expressed in having syntax highlighting for Markdown. This may require some performance investigation because syntax highlighting may be CPU intensive. Would rather have real-time preview than a colourful editor. That said, it may be that some sprinkling of syntax highlighting would not bog down the CPU.

DaveJarvis avatar Jul 07 '20 04:07 DaveJarvis