How can I disable diff in line separators in IntelliJ IDEA?

后端 未结 5 1045
失恋的感觉
失恋的感觉 2021-02-04 02:00

I\'m using Intellij IDEA 14 on Windows and Git as VCS on Unix server. The line separator in Windows is CLRF (\\r\\n) and LF (\\n) in Unix. In Git, I\'m

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-04 02:32

    Create parser.py in the same dir. Change the name and run. Enjoy))

    with open('./file_to_fix.py', 'r') as f:
        a = f.read()
    
    with open('./file_to_fix.py', 'w') as f:
        # for i in a.split('\r\n'):
        #     f.write(i)
        aa = a.replace('\r\n', '\n')
        f.write(aa)

提交回复
热议问题