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

Toggle Syntax Highlighting #38

Open
amay5267 opened this issue Nov 30, 2022 · 7 comments
Open

Toggle Syntax Highlighting #38

amay5267 opened this issue Nov 30, 2022 · 7 comments

Comments

@amay5267
Copy link

Hi @magiblot
How to Toggle Syntax Highlighting?
Personally I would like to be able to toggle syntax highlighting on/off for C/CPP.

@magiblot
Copy link
Owner

Hi @amay5267!

There is currently no way to select the syntax highlighting or disable it manually, but it gets automatically enabled in these cases:

  • When opening a file with C/C++ extension.
  • When saving a file with C/C++ extension.

So, for example, if you open a new editor with Ctrl+N, you can enable syntax highlighting by saving the file with a .cpp/.cc/.h/etc. extension. Or, if you want to create a source code file from the command line, and you run turbo newSourceFile.cc, you will get an editor with syntax highlighting even though the file newSourceFile.cc does not exist yet.

I don't know if this is enough for what you are trying to do.

@amay5267
Copy link
Author

Hi @magiblot
How to switch syntax off manually in source code for C/CPP?
I like how it behaves in C# source code case e.g. newSourceFile.cs - no syntax color you see.
How to do the same as C# but for pure C source code ?

@amay5267
Copy link
Author

How to not automatically enable syntax highlighting in newSourceFile.c and newSourceFile.cc files?

@amay5267
Copy link
Author

It is not automatically enabled in C# source code e.g. newSourceFile.cs

@magiblot
Copy link
Owner

Okay, now I understand you. There's currently no way to do this; C# source files do not get syntax highlighting because it is not supported yet.

I can implement this.

@amay5267
Copy link
Author

Perfect! As a temporary workaround I write C source code but save it with .cs extension. Than I rename the file with Turbo and with .c extension

@amay5267
Copy link
Author

I am not sure if you are familiar with Vim.
If you do vim HelloWorld.c, vim opens HelloWorld.c with syntax on. Now if you are in vim and write :syntax off - magic happens.
I want the same magic in Turbo.

@magiblot magiblot reopened this Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants