diff --git a/src/EditorView.swift b/src/EditorView.swift index eb0fa6f..56efa55 100644 --- a/src/EditorView.swift +++ b/src/EditorView.swift @@ -49,11 +49,18 @@ class MarkdownLayoutManager: NSLayoutManager { var skipRanges: [NSRange] = [] for block in blockRanges { - guard case .checkbox(let checked) = block.kind else { continue } let glyphRange = self.glyphRange(forCharacterRange: block.range, actualCharacterRange: nil) guard NSIntersectionRange(glyphRange, glyphsToShow).length > 0 else { continue } - skipRanges.append(glyphRange) - drawCheckbox(checked: checked, glyphRange: glyphRange, origin: origin, container: textContainer) + + switch block.kind { + case .checkbox(let checked): + skipRanges.append(glyphRange) + drawCheckbox(checked: checked, glyphRange: glyphRange, origin: origin, container: textContainer) + case .horizontalRule: + skipRanges.append(glyphRange) + default: + break + } } if skipRanges.isEmpty {