coteditor / CotEditor

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

General mode is unexpectedly activated for editing shell script file #1629

Closed gingerbeardman closed 5 months ago

gingerbeardman commented 5 months ago

Description

I am editing a shell script and notice that smart quotes is now turning back on every time i open the document.

To Reproduce

  1. open a shell script without shebang
  2. type "test", or similar

Actual behavior

Expected behavior

CotEditor version

macOS version

Additional context

gingerbeardman commented 5 months ago

It seems my shell script is not recognised as a shell script.

Why does it ignore selected syntax in toolbar?

Here are its properties:

image
1024jp commented 5 months ago

With the default settings, a file with .sh file extension should be mapped to the Shell Script. When the pop-up menu in the toolbar says it is Shell Script, the document is recognized as a Shell Script document. Then, (also with the default settings,) the mode for the editor is mapped according to the syntax kind defined in the syntax itself, which can be edited from the Format settings pane > Available syntaxes list. If you have customized the Shell Script, the behavior can be changed. Check it once more.

Screenshot 2024-05-01 at 16 57 32
gingerbeardman commented 5 months ago

Yes, somehow Shell Script syntax was set to General for me.

Instead of choosing Restore Defaults and losing any other changes I am not sure about, I changed kind to Code.

Screen shot 2024-05-01 at 17 26 23 Screen shot 2024-05-01 at 17 27 21