Editor
enum Editor
Static settings and functions for the editor
-
The line height multiplier for the editor text
Declaration
Swift
static let lineHeightMultiple: Double = 1.6 -
The style of a number in the ruler
Declaration
Swift
static var rulerNumberStyle: [NSAttributedString.Key: Any] -
The foreground of the highlighted line in the editor
Note
Avarto keep it up-to-date when the accent color is changedDeclaration
Swift
static var highlightedForegroundColor: NSColor -
The background of the highlighted line in the editor
Declaration
Swift
static let highlightedBackgroundColor: NSColor = .gray.withAlphaComponent(0.1) -
Edit a
Directivewith its argument in theChordProEditorDeclaration
Swift
static func format( directive: ChordPro.Directive, editorInternals: ChordProEditor.Internals )Parameters
directiveThe
Directiveto applyeditorInternalsThe internals of the
ChordProEditor
-
Settings for the editor
See moreDeclaration
Swift
struct Settings: Equatable, Codable, Sendable -
The type of regex
See moreDeclaration
Swift
enum RegexType -
The regex for chords
Declaration
Swift
static let chordRegex = try! NSRegularExpression(pattern: "\\[([\\w#b\\/]+)\\]", options: .caseInsensitive) -
The regex for directives
Declaration
Swift
static let directiveRegex = try! NSRegularExpression(pattern: "\\{(\\w+):?([^\\}\\n]+)?(?:\\}|\\n)") -
The regex for comments
Declaration
Swift
static let commentsRegex = try! NSRegularExpression(pattern: "(?<=^|\\n)(#[^\\n]*)") -
The regex for markup
Declaration
Swift
static let markupRegex = try! NSRegularExpression(pattern: "<\\/?([^>]*)>") -
The regex for
key=valueDeclaration
Swift
static let keyValueRegex = try! NSRegularExpression(pattern: "\"\\/?([^\"]*)\"") -
The regex for brackets
Declaration
Swift
static let bracketsRegex = try! NSRegularExpression(pattern: "\\/?([\\[\\]\\{\\}\"\\<\\>/])") -
The regex for new lines
Declaration
Swift
static let newLineRegex = try! NSRegularExpression(pattern: "\n", options: []) -
The highlight regex dictionary for the text editor
Declaration
Parameters
settingsThe
Settingsof theChordProEditorReturn Value
The highlight regex dictionary
View on GitHub