coteditor / CotEditor

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

default automatic-substitution settings for the kind "general" conflict with some markup languages #1624

Closed daitakahashi closed 2 months ago

daitakahashi commented 2 months ago

Description

Recent CotEditor introduced a syntax mode (general or code). The major difference between those modes seems to be their default automatic-substitution settings (enabled by default for general and disabled for code).

The problem is, some markup languages that are currently marked as kind: general use literal " (double quote) or multiple hyphens in their markup syntax, for example,

Because of that, the default settings for the kind: general that substitute multiple hyphens and open/close quotes are not suitable for editing those markup languages.

To Reproduce

  1. (use default settings)
  2. open TOML file or create TOML file
  3. type key = "value" (valid TOML)
  4. the "value" will be replaced by “value” (enclosed by open and close double quotes)
  5. resultant key = “value” is not a valid TOML

Expected behavior

those markup languages are treated as kind: code

CotEditor version

4.8.1 (644)

macOS version

14.4.1 (23E224)

Additional context

No response

1024jp commented 2 months ago

I understand your opinion. In the early stage, I also envisioned three syntax types: "General," "Code," and "Structured Language," but decided against it because I thought that structured languages would be unfamiliar to many users and would be difficult. I therefore kept the fundamental policy of CotEditor thorough and kept the functions provided by default simple. However, I left room for customization. In fact, CotEditor's modes can be set also for individual syntaxes in addition to the syntax kinds.

If you want to change the editor's behavior only for specific syntaxes, such as TOML, add the target syntax from the plus button in the Mode settings and configure individual settings for them.

Screenshot 2024-04-24 at 20 47 31
daitakahashi commented 2 months ago

I see. This is just a matter of the default settings, and I understand that there is a way of customize it.

~~What confused me was, maybe, implicit associations between those markup languages and the "General" mode. As we all may have different ideas for categorize those languages (e.g., I may think LaTeX is "code" rather than "general document"), I prefer to see all available syntax on the left pane of the setting by default to see its functionality without surprise.~~ Sorry, I found it at a format > available syntax > edit pane. Thank you very much.

1024jp commented 2 months ago

In consideration of your feedback, I will make the following two changes in the next CotEditor 4.8.2:

Again, thank you for your feedback.