Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gingerbeardman opened this issue Apr 29, 2024 · 3 comments
Closed
Labels
potential bug issues not yet tested

Comments

@gingerbeardman
Copy link

gingerbeardman commented Apr 29, 2024

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

  • general mode activated
  • quotes are transformed to smart quotes

Expected behavior

  • these options should remain as the user last selected
  • Shell script file should not be activating General mode, use Code mode!
  • Mode should be active by selected syntax, rather than any other heuristic

CotEditor version

  • 4.8.1 (644)
  • 4.8.2 (647)

macOS version

  • 14.4.1 (23E224)

Additional context

  • related to the new "Mode" feature
  • found a hint for the solution to turn them off at Disabling smart quotes #1248
  • In latest version it's at: Settings > Mode > General > Smart quotes
  • Mode feature is not predictable
@gingerbeardman
Copy link
Author

gingerbeardman commented Apr 29, 2024

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

Why does it ignore selected syntax in toolbar?

Here are its properties:

  • filename: hash.sh
  • shebang: no
  • permissions: 755 (-rwxr-xr-x)
image

@gingerbeardman gingerbeardman changed the title General mode is activated for editing shell script file General mode is unexpectedly activated for editing shell script file Apr 29, 2024
@1024jp
Copy link
Member

1024jp commented May 1, 2024

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
Copy link
Author

gingerbeardman commented May 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug issues not yet tested
Development

No branches or pull requests

2 participants