coteditor / CotEditor

Lightweight Plain-Text Editor for macOS
https://coteditor.com
Other
6.24k stars 427 forks source link

Add settings to suppress the inconsistent line-ending warning pop-up #1507

Closed czack810150 closed 10 months ago

czack810150 commented 11 months ago

Is your feature request related to a problem? Please describe. As a software developer, I've used CotEditor to open all sorts of logs files all the time and many of them have inconsistent line endings. Every time I open such file, I get a pop-up message saying "The document has inconsistent line endings." and whether I want to convert them. I constantly had to click on ignore for any new files I open which becomes annoying after a few times.

Can we have a settings to permanently suppress this inconsistent line ending message? This would save people who don't care about line ending a somewhat annoying click.

Describe the solution you'd like Add a check box or something that suppress the inconsistent line ending pop-up when a file is opened. With that check box checked, the pop-up does not show.

Describe alternatives you've considered No alternative

Additional context image

1024jp commented 11 months ago

Thank you for sharing your use case.

Actually CotEditor already has a hidden setting suppressesInconsistentLineEndingAlert for it. (cf. #1331) Running the follow command in Terminal suppress the dialog entirely.

defaults write com.coteditor.CotEditor suppressesInconsistentLineEndingAlert -bool YES.

Let me consider further to add a GUI setting for it. I've thought the demand is a kind of rare case. But if there are specific number of people need this option, it's reasonable to add.

czack810150 commented 11 months ago

@1024jp thanks for pointing me to the hidden settings. Is there a doc where I can read about all these hidden settings?

1024jp commented 11 months ago

Is there a doc where I can read about all these hidden settings?

Sorry, but not. I knew it was better to have it, but at the same time, I was too lazy to do it. In addition, because most of them are just for maintenance or trivial usage, they can be removed suddenly without any announcement.

You can see some of them in the code below and guess from the name... https://github.com/coteditor/CotEditor/blob/250072c6e344a4422d1b1ee0070c02b38840074f/CotEditor/Sources/DefaultKeys.swift#L167-L175

1024jp commented 10 months ago

I've added the GUI to suppress the inconsistent line endings warning entirely to the next version.

Screenshot 2023-08-29 at 22 56 54