Skip to content
Open
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
Fix markdown syntax highlighting by mapping capture names
The markdown tree-sitter grammar uses nvim-treesitter capture names
(e.g. text.title, punctuation.special) that CaptureName.fromString()
didn't recognize, causing all markdown highlights to be silently dropped.

Map these to existing CaptureName cases so no new enum values or theme
changes are needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Loading branch information
matiaskorhonen and claude committed Mar 14, 2026
commit 148d0290ce152fb13fc5a8bc2e883ea970afa25b
12 changes: 12 additions & 0 deletions Sources/CodeEditSourceEditor/Enums/CaptureName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ public enum CaptureName: Int8, CaseIterable, Sendable {
return .keywordReturn
case "keyword.function":
return .keywordFunction
case "text.title", "text.strong", "punctuation.special":
return .keyword
case "text.literal", "text.uri", "string.escape":
return .string
case "text.reference":
return .type
case "text.emphasis":
return .variable
case "punctuation.delimiter":
return .comment
case "none":
return nil
default:
return nil
}
Expand Down