CTRL-M for octothorps

General questions about using TextPad

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

Post Reply
Peter Bradshaw

CTRL-M for octothorps

Post by Peter Bradshaw »

I occasionally need to find my way among lots of nested pre-processor conditionals (#if and kin ). It would be nice it there was a CTRL-M like function to work with octothorps (#). Then #if, #ifdef and #ifndef would be akin to an opening bracket and #endif akin to a closing bracket while #else and #elif would be ignored. Don't see an easy way to do it. Am I missing something obvious?
N. Demos

Re: CTRL-M for octothorps

Post by N. Demos »

There is a control-M function in Textpad 4.5, but it doesn't work with #if etc.

If you want to be able to jump to a matching pre-processor delimiter, you might try using commented brackets (I'm assuming this is C/C++ code).

Example:
#if (Statement) // {
#if (Statement) // {
...
#else
...
#endif // }
#else
...
#endif // }

For existing code, this could be easily implemented with the Replace Tool

Regards,
N. Demos
Post Reply