Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: incorrect Swift 5.7+ syntax highlighting related to extended regex literals #1795

Open
marc-medley opened this issue Jan 24, 2025 · 0 comments
Labels
potential bug issues not yet tested syntax highlight issues related to syntax highlighting

Comments

@marc-medley
Copy link

marc-medley commented Jan 24, 2025

Description

BUG: The CotEditor swift syntax highlighting is not correct for extended regex literal syntax. The issue is easy to see with the quotation character(s) inside the /# #/ regex literal syntax. However, this may be more an issue with the #/…/# swift regex syntax in general.

To Reproduce

  1. Create a swift file which includes extended regex literal which include a quotation character as part of the #/…/# Swift extended regex literal pattern. For example:

    s0 = s0.replacing(#/\n([a-zA-Z*"'–])/#) { m in
        return "    \(m.1)" // indent body below heading link
    }
    
    // Main:
    if logit.logLevel == .debug {
        writeCheckpoint(s1, base: urlBase, ext: "4a_part.md")
    }
  2. Observe the resulting syntax highlighting.

Expected behavior

CotEditor highlighting was not expected:

Image

Xcode highlighted as expected. The same section of code is highlighted in Xcode correctly as shown below:

Image

CotEditor version

5.0.8 (692)

macOS version

15.2

Additional context

No response

@marc-medley marc-medley added the potential bug issues not yet tested label Jan 24, 2025
@1024jp 1024jp added the syntax highlight issues related to syntax highlighting label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug issues not yet tested syntax highlight issues related to syntax highlighting
Development

No branches or pull requests

2 participants