Skip to content

Conversation

hakakou
Copy link

@hakakou hakakou commented Feb 11, 2020

Description

Before pasting a block of code, all common padding is stripped, but relative indentation is preserved.
I needed this because C# tends to have a lot of indentation if the interesting code happens to be already nested deep in some namespace/class/function. By trimming the common white space, the code is much easier to read on a cell phone with limited space (less need for horizontal scrolling).

For example, copying and pasting:

                param.MetaRequest = new BoxMetaRequest[]
                {
                    new BoxMetaRequest()
                    {
                          Name = "Frame",
                    }
                }

Becomes:

param.MetaRequest = new BoxMetaRequest[]
{
    new BoxMetaRequest()
    {
          Name = "Frame",
    }
}

Checklist:

Please replace the space inside the brackets with an x and fill out the ellipses if the following items apply:

  • I've read and understood the contribution guidelines
  • I've tested my changes against at least one of the following Anki builds:
    • Latest standard Anki 2.1 binary build [required for Anki-compatible 2.1 add-ons]
    • Latest alternative Anki 2.1 binary build
    • Latest Anki 2.0 binary build [required for Anki 2.0-compatible add-ons]
  • I've tested my changes on at least one of the following platforms:
    • Linux, version:
    • Windows, version: 10
    • macOS, version:
  • My changes potentially affect non-desktop platforms, of which I've tested:
    • AnkiMobile, version:
    • AnkiDroid, version: 2.9.2
    • AnkiWeb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant