Skip to content

Windows-style line endings are sometimes highlighted as errors #32

Open

Description

@Arcensoth

This issue became apparent in #16 but was deferred until more information was available.

Here are the relevant details from the discussion in that report:

At some point - probably as a side-effect of an earlier fix - I must have fixed the trailing arguments being highlighted as errors, but the ^M is a slightly different red and I don't think it's a problem with the syntax highlighter. Here's some research:

It looks like people might be committing files with CRLF and then GitHub decides to force-highlight the carriage returns.

We'll see how the next Linguist update handles the affected files and re-open if it's clear there's more to be done here.

An update, for posterity:

GitHub Linguist has been updated, and is now running v0.13.0 of language-mcfunction.

As expected, the trailing arguments are being highlighted properly but the ^M characters remain:

https://github.com/Gamemode4Dev/GM4_Datapacks/blob/master/gm4_phantom_scarecrows/data/phantom_scarecrows/functions/main.mcfunction#L2

Like I mentioned in my last comment, I'm not confident that this is a problem with the grammar itself but instead that people are committing carriage returns to mcfunction files. It may be the grammar's fault that these characters are being highlighted, but after some testing (via github-lightshow) I was unable to remove these characters by any means.

Until I have more definitive information about the problem and/or people reporting it, I'm going to work under the assumption that this is out of the grammar's control.

I'm still unsure exactly what's causing this problem, but it any case it can probably be fixed with some effort.

Activity

  1. self-assigned this
    on Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions