Option to restrict macro to a single document type
Posted: Tue Dec 28, 2004 11:54 pm
I would love to be able to, for example, set up document-type-specific macros for "Comment" and "Uncomment", and use the same shortcut key combo for any (programming) document type.
The default behavior (if the Restrict checkbox is not checked) would be the current behavior: make the macro available for all document types.
- Sam[/list]
- Example: Comment/Uncomment
In a Python file, ctrl-\ would invoke the CommentPython macro to insert a '#' at the beginning of the line, but in a Javascript or C/C++ file it would invoke an alternate macro to insert '//' and in a DOS/Windows .bat file it would invoke yet another macro to insert 'REM'.
Similarly, ctrl-shift-\ would invoke the appropriate Uncomment macro to remove the appropriate comment character or sequence of characters.
FWIW, I'm forever inserting '#' in Javascript files by hitting the Comment Lines shortcut key. (My Comment Lines macro is set up for Python.)
- 1. Checkbox to restrict plus selection list to select a single document type. A macro could be either unrestricted or restricted to a single document type.
This would mean that separate macros would be needed for different document types even if they use the same comment sequence (for example, C++ and Javascript files).
- 2. Checkbox to restrict plus selection list to select one or more document types. A macro could be either unrestricted or restricted to one or more document type(s).
The default behavior (if the Restrict checkbox is not checked) would be the current behavior: make the macro available for all document types.
- Sam[/list]