Add syntax highlighting with syntect.

This commit is contained in:
2025-03-31 22:32:17 -04:00
parent 365940267f
commit 9b86553513
4 changed files with 273 additions and 16 deletions

View File

@@ -67,7 +67,6 @@ SplitView {
// Show the line number.
Label {
id: numbers
color: RustColors.linenumber
font: textArea.font
height: parent.height
@@ -79,7 +78,6 @@ SplitView {
// Draw edge along the right side of the line number.
Rectangle {
id: indicator
anchors.left: numbers.right
color: RustColors.linenumber
height: parent.height
@@ -103,19 +101,17 @@ SplitView {
TextArea.flickable: TextArea {
id: textArea
color: RustColors.editor_text
focus: true
persistentSelection: true
antialiasing: true
selectByMouse: true
selectedTextColor: RustColors.editor_highlighted_text
selectionColor: RustColors.editor_highlight
selectedTextColor: RustColors.editor_highlighted_text
textFormat: Qt.AutoText
wrapMode: TextArea.Wrap
text: FileSystem.readFile(root.filePath)
background: Rectangle {
color: RustColors.editor_background
Component.onCompleted: {
textArea.text = FileSystem.readFile(FileSystem.filePath)
}
onLinkActivated: function (link) {