We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    My autocrlf setting was working well until I started using static elements. I'm not sure what line-ending format MODX uses to write static element files (or if it can be modified), but I'm getting a lot of CRLF warnings from Git when committing after saving a static element file.

    I'm assuming that PhpStorm and MODX are not using the same format when saving files. I think changing what MODX does would be easiest if that's possible.

    Can anyone shed some light on this before I start messing with things?


    ------------------------------------------------------------------------------------------
    PLEASE, PLEASE specify the version of MODX you are using.
    MODX info for everyone: http://bobsguides.com/modx.html
      Did I help you? Buy me a beer
      Get my Book: MODX:The Official Guide
      MODX info for everyone: http://bobsguides.com/modx.html
      My MODX Extras
      Bob's Guides is now hosted at A2 MODX Hosting
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Well, your MODx is probably installed on a Linux server, and your phpStorm is probably a Windows app. So they would use different line endings. I would recommend changing the phpStorm, personally, as Windows is not very good for that sort of thing.

      http://devnet.jetbrains.net/message/5266888;jsessionid=41A79A3724E968A62401FE55DF4E6D62#5266888
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 3749
        • 24,544 Posts
        It's a localhost XAMPP install, so MODX is running under Apache, but on Windows.

        MODX sets the line endings to something explicit (probably "\n"), but I don't know if they're changed when the file is saved (and I'm hoping I don't have to write code to find out wink ).

        BTW, if I'm reading that thread correctly, PhpStorm converts everything to "\n" when you load a document and changes all line endings to the system native format when you save. There's no way to change that.

        The section on controlling line endings refers to Git, not PhpStorm.



        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html [ed. note: BobRay last edited this post 14 years, 1 month ago.]
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting