Page 1 of 1

Apply adhoc class to open file

Posted: Mon Feb 15, 2016 11:06 pm
by rkrite
Hi,

Is there a way that I am able to apply a class to an open file that is currently in a different (or no) class?

EG.
* I have set up a class for "Shell Scripts" (*.ksh, *.sh)
* I have set up a class for "SQL Scripts" (*.sql)
* I have a few files in my dev repo that do not have file extensions (eg. MySQLScript, MyShellScript)
* When I open MyShellScript file, I would like the ability to select and apply the "Shell Scripts" class to this particular open file in an adhoc manner so I can have this open file make use of things like Syntax Highlight, desired tabs, etc.
* In the same session, I would also like to apply the "SQL Scripts" to another file MySQLScript.

Is there a way to do this?

Thanks

Re: Apply adhoc class to open file

Posted: Mon Feb 15, 2016 11:08 pm
by rkrite
rkrite wrote:Is there a way that I am able to apply a class to an open file that is currently in a different (or no) class?
BTW, I am using Textpad v 5.2.0.
Thanks

Posted: Tue Feb 16, 2016 12:16 am
by MudGuard
I can't remember if it worked in such a historic version as 5.2.0 - in current versions you can press Alt-Return, switch to syntax tab, then apply whatever syntax you want.

Not exactly the class assignment you want, but might be close enough.

In same dialog, you can also adapt tabulation and so on, but not by choosing a different class, only by manually adapting each setting.

Posted: Tue Feb 16, 2016 12:21 am
by rkrite
MudGuard wrote: Not exactly the class assignment you want, but might be close enough.
Thanks MudGuard. Indeed, this is exactly what I was after.
... And yes, it is working in 5.2.0 :D
Thanks very much.