applying syntax coloring to files without extentions

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
bwvoris

applying syntax coloring to files without extentions

Post by bwvoris »

C++ header files have (per the standard) no extension. For example <string>. (That is, extensions such as .hpp, etc. are deprecated.)

Is there a way to tell TextPad that this file without an extension is C++, whereas that file without extension is not?

Thanks.
User avatar
SteveH
Posts: 327
Joined: Thu Apr 03, 2003 11:37 am
Location: Edinburgh, Scotland
Contact:

applying syntax coloring to files without extentions

Post by SteveH »

While you can apply syntax colouring to files without extensions it will apply to all files of that type.

The practicalities are that you need to add the filter '*.' to the document classes (remembering to remove this from the text document class).
bwvoris

applying syntax coloring to files without extentions

Post by bwvoris »

Helios, are you listening?

We need a something like a "format as" command. Once that's in place, I'd like the workspace to remember the file type of files without an extension. For example, "string" is C++, but "make" is a make file.

Files I commonly see without extensions are HTML, C++, and make files. Changing '*.' isn't really an option, because I commonly have all last two open at once.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

We need a something like a "format as" command.
View -> Document Properties -> Syntax ...
Once that's in place, I'd like the workspace to remember the file type of files without an extension.
As far as I have tested, a workspace saves the setting made under View -> Document Properties...
Is there a way to tell TextPad that this file without an extension is C++, whereas that file without extension is not?
See above, yes, and together with workspaces the info is saved.
bwvoris

applying syntax coloring to files without extentions

Post by bwvoris »

This works for me.

Thanks!

(Now, if I could just give TextPad a list of files, not extensions, that would be even better -- but I'm not complaining.)
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

You commented:
Now, if I could just give TextPad a list of files, not extensions, that
would be even better -- but I'm not complaining.)
This should solve your problem:

Start TextPad with the command option @filename.

This will open all the files that are listed, one per line, in the specified file. This overrides the option to load the workspace, specified on the General page of the Preferences dialog box.

See "Command Line Parameters" in the Help Section. Lots of useful options there.
Hope this was helpful.............good luck,
Bob
Post Reply