syntax highlighting in view source for IE5

General questions about using TextPad

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

Post Reply
Prasad S.

syntax highlighting in view source for IE5

Post by Prasad S. »

I installed and ran txplink2000 and I am able to use textpad for all things that try to open notepad. My motivation behind doing this was to be able to view source for HTML pages using texpad which does syntax higlighting. I have to deal with a lot of HTML.

However, IE saves its cache files without *.htm* extensions, and as a result textpad does not know to use the html syntax. How can I have that happen w/o actually saving the source to a file with htm extensionand opening it?

I am using 4.4.0 on win2K - Toshiba laptop.

Thanks much,
--Prasad
Andreas

Re: syntax highlighting in view source for IE5

Post by Andreas »

If you do not use files without extensions in a different document class, you could assign *. to the document class - it works for me.
I had tried to assign *[*]. or *[*] but neither survived closing Textpad.

Andreas
Andreas

Re: syntax highlighting in view source for IE5

Post by Andreas »

Uuuups, left out one word, it should have been
you could assign *. to the HTML document class

I also have tried to use the path to the folder used by IE but textpad does not allow paths for recognizing document classes

Andreas
moderator

Re: syntax highlighting in view source for IE5

Post by moderator »

Hi there

You can add the following key to the registry then add the path to TextPad as the value data.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name]

@="C:\Program Files\TextPad\TextPad.exe"

Then when you click on view source in IE, TextPad should open the file.

Hope that helps!

Heidi-Marie
Richard Thomas

Re: syntax highlighting in view source for IE5

Post by Richard Thomas »

You can also do this through the GUI - go to Control Panel/Internet Options. Then choose the Programs tab, and then choose Textpad from the drop-down list for HTML editor.
Andreas

Re: syntax highlighting in view source for IE5

Post by Andreas »

Dear Heidi-Marie,

thanks for your input, but:
the problem is not to have the source sent to textpad from IE,
the problem is that Textpad does not recognize that the file belongs to the HTML document class because IE does not append .html to the name of the temporary file.

Andreas
moderator

Re: syntax highlighting in view source for IE5

Post by moderator »

To solve the other problem try the following:

1. Click on Configure
2. Click on Preferences
3. Click on the + before Document classes
4. Click on Text
5. Delete the
*.
in "Files in class text"
6. Add
*.
To "Files in class HTML" or what you have called it
7. Click OK.

Kind Regards

Heidi-Marie
Andreas

Re: syntax highlighting in view source for IE5

Post by Andreas »

Thanks again, Heidi-Marie,
yes, I know how to do this, but this brings other problems...
If I do this, all unix shell scripts (which also don't have an extension) now get HTML highlighting.

And I do not blame textpad for that - IE should properly name the temporary files used for source viewing.

It could only be solved on textpad side if the pattern for recognizing the document class of a file were expanded: it would need to include the path (so you could say all files in <browser temp-file folder> matching *. are treated as HTML while all other files matching *. would be treated as <whatever the *. without path is matched by> class.

Andreas
moderator

Re: syntax highlighting in view source for IE5

Post by moderator »

Hi Andreas

You are very welcome. I will add your suggestion to the wish list and hopefully this will be in a future release of TextPad.

Cheers

Heidi-Marie
Pawson

Re: syntax highlighting in view source for IE5

Post by Pawson »

I have been trying to get View Source in Textpad to work using the Registry instructions Heidi-Marie gave, but whenever I try to view source on a page, I am prompted by Textpad to create several temporary files on my desktop. Regardless of how I reply to the prompts I am unable to view the source.

Anyone else having this problem?

Pawson
Andreas

Re: syntax highlighting in view source for IE5

Post by Andreas »

Set the "Allow multiple files on command line" to unchecked.
Your browser uses a folder for the temporary files which has blanks in its name.
If textpad is configured to accept multiple files, it thinks each part is a file (e.g. "c:\temporary" as first part, then "internet", then "files\source.htm").

Andreas
Pawson

Re: syntax highlighting in view source for IE5

Post by Pawson »

Ah perfect, thanks a lot.

Pawson
Ian Northwood

Re: syntax highlighting in view source for IE5

Post by Ian Northwood »

Also, I believe this only works when clicking the 'Edit' button in IE, but is ignored for right-clicking and selecting 'View source'. I played this game a few weeks ago and the reg hack is the way to get HTML source into TP.
Post Reply