I often want to insert a TAB character (ascii 09) into text, for example when I need to modify a makefile, or when I need to modify a source which has such ascii codes in it. Is there a way to do it?
(Without going to settings and enabling tabs there.. since I only need one single tab, but normal indentation for my normal source code..)
Since you do not want to edit settings, the only way to get this done is to type a tab char in notepad, copy that char, and paste it into the source...
If you need a tab character in a character string, it is of course easier to use \t :)
Or another more funny solution would be using AngelScript.
You would only need to create a script that does something like:
// toggle tab usage
bool use = editor->GetUseTabs();
editor->SetUseTabs(!use);
And then register a menu with it along with an accelerator.
The only (minor?) problems with it are:
-*UseTabs() function are not registered, you'll need to register it in scriptbindings.cpp, and recompile C::B.
-Can a script create a new menu entry with an accelerator?
-The script would be loaded once, or it would be loaded each time the function is needed?
A menu entry would be perfect. Anyway, since I don't feel like recompiling myself, I just filed a feature request :)
But it'd be of actually use with AngelScript, or the ActionsManager stuff, or perhaps some future Macros recording feature.
As of now, putting a hardcoded menu for SetUseTabs() would polute menus only.
Yes, I guess having a script for it (which I could add/enable/install/[anything but requiring me to completely recompile a huge C++ project]) would be best.