Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CodeEditModules/Modules/CodeFile/src/CodeEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ struct CodeEditor: NSViewRepresentable {
scrollView: scrollView
)
)

if let highlightr = highlightr,
let string = highlightr.highlight(
content.wrappedValue,
as: language?.rawValue,
fastRender: true
) {
textView.textStorage?.append(string)
}

textView.autoresizingMask = .width
textView.maxSize = NSSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude)
textView.minSize = NSSize(width: 0, height: scrollView.contentSize.height)
Expand Down
1 change: 1 addition & 0 deletions CodeEditModules/Modules/CodeFile/src/Model/Language.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ extension CodeEditor {
case haxe
case hsp
case htmlbars
case html
case http
case hy
case inform7
Expand Down