[PR #4555] [MERGED] When patching profiles in, copy the user's indentation #25832

Open
opened 2026-01-31 09:12:05 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4555
Author: @DHowett-MSFT
Created: 2/12/2020
Status: Merged
Merged: 2/13/2020
Merged by: @undefined

Base: masterHead: dev/duhowett/tryindent


📝 Commits (1)

  • eacaf79 When patching profiles in, copy the user's indentation

📊 Changes

1 file changed (+9 additions, -5 deletions)

View changed files

📝 src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp (+9 -5)

📄 Description

This will attempt to match the style of the user's JSON.

Caveats:

  1. If the user has no profiles, it'll explode. This isn't new.
  2. If the user's indentation style if {profile}, {profile}, {profile} (that is: no indentation), you'll get this:
{profile}, {profile}, {profile},
 {
     new profile content
 }

There may be something better we can do by copying their newline (or lack thereof) and using it in our generator or detecting the indentation of their members as well.
That's an exercise for later.

Ref #2805


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4555 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 2/12/2020 **Status:** ✅ Merged **Merged:** 2/13/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/duhowett/tryindent` --- ### 📝 Commits (1) - [`eacaf79`](https://github.com/microsoft/terminal/commit/eacaf79e424c599d4cf139c125d1b7011687aa4b) When patching profiles in, copy the user's indentation ### 📊 Changes **1 file changed** (+9 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp` (+9 -5) </details> ### 📄 Description This will attempt to match the style of the user's JSON. Caveats: 1. If the user has no profiles, it'll explode. This isn't new. 2. If the user's indentation style if `{profile}, {profile}, {profile}` (that is: no indentation), you'll get this: ``` {profile}, {profile}, {profile}, { new profile content } ``` There may be something better we can do by copying their newline (or lack thereof) and using it in our generator or detecting the indentation of their members as well. That's an exercise for later. Ref #2805 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:12:05 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25832