mapeditor / mapeditor/tiled

Unify line breaks

Open
#3,813 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

Is your feature request related to a problem? Please describe.

The JSON exporter saves *.tmj files on macOS with "LF" \n line breaks, as expected. On Windows, the exporter saves with "CRLF" \r\n line breaks. This causes git to warn about spurious line break changes when saving a map that otherwise has no differences.

Describe the solution you'd like

UTF-8 and Unix line breaks are the De Facto standard for text-based files, and any text editor worth its salt can read and write these files without issue, across all platforms.

Unify line breaks when exporting text files to "LF" \n on all platforms.

Describe alternatives you've considered

There is no alternative. Windows line breaks are ancient technology, just like UTF-16.

In seriousness, I did have some minor success by switching to the json1.dll plugin in the Windows build. While this plugin does save JSON files with Unix line breaks, it also changes the embedded version number to "1.1" (the json.dll plugin saves with version "1.10").

I chose to stick with the default json.dll plugin and created this ticket to track the issue. I can always use dos2unix if I really need to fix up the line breaks locally.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the JSON exporter and comparing the default json.dll and json1.dll plugin behavior on Windows and macOS. Done means exported text files use LF line breaks on all platforms without changing the embedded version from 1.10.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.