# TERRIBLE code editor/tags

This topic is 2373 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I agree, the input box got a lot worse in the new forum. I think it got a lot better when I disabled visual (RTE) editor in Posting Settings. You could try that.

##### Share on other sites
Agreed. I paste stuff into notepad first, format it all and then paste it into the window here. If I paste it directly from VS, all hell breaks lose.

##### Share on other sites
Second Wooh's suggestion to turn off the RTE (you can do this in your profile) and just manually type the tags like we used to. I did this fairly shortly after having similar feelings about the editor when it first came in and I have no trouble with it now.

The way it makes tabs eight spaces in a code box is still a bit of an annoyance but I just added a tabs-to-spaces feature to my text editor and make sure I run any actual code from an editor through that before I post.

Staff? Would it be possible to address the length of tabs in code boxes? Now pasting this, just from a plain text editor, with some tabs:

 int main() { for(int i=0;i<10;++i) { std::cout << "Icky\n"; } } 

I don't know anyone who has their tabs set to that many spaces in real code and find it hard to read, but it would be nice to be able to just paste direct from an IDE without having to mess about replacing the tabs with spaces.

Minor nitpick, sure you have lots of more important things to worry about.

##### Share on other sites
 int main() { int a; int b; int c; } 
Thanks for the tip about RTE. I switched it off and indeed: the editor is MUCH better now.
But the code tag still looks so unbelievable ugly. I can barely see the dark blue brackets on the dark background. Seriously, even NO highlighing at all would be better. The old syntax highlighting was 100times better:/

##### Share on other sites

 int main() { int a; int b; int c; } 

But the code tag still looks so unbelievable ugly. I can barely see the dark blue brackets on the dark background.

Mmm, just tried the black alpha theme and it isn't that bad in my view, but it does look a lot nicer in classic, if you can bear all the bright pages. Never got on with black theme, myself.

##### Share on other sites

[quote name='schupf' timestamp='1306087491' post='4814300']
 int main() { int a; int b; int c; } 

But the code tag still looks so unbelievable ugly. I can barely see the dark blue brackets on the dark background.

Mmm, just tried the black alpha theme and it isn't that bad in my view, but it does look a lot nicer in classic, if you can bear all the bright pages. Never got on with black theme, myself.
[/quote]
I switched the theme to the bright one and yes, now it's readable:)
I still think it is a little bit odd, having default settings that are bad. If I were an admin I would switch of RTE and the black them by default.

##### Share on other sites
[font="Courier New"][color="#808000"]#include "app.h"[/font]

[font="Courier New"]app::app()[/font]
[font="Courier New"]{[/font]

[font="Courier New"]}[/font]

[font="Courier New"]app::~app()[/font]
[font="Courier New"]{[/font]

[font="Courier New"]}[/font]

[font="Courier New"][color="#000080"]void app::configure()[/font]
[font="Courier New"]{[/font]
[font="Courier New"] call_configure.call();[/font]
[font="Courier New"]}[/font]

[font="Courier New"][color="#000080"]void app::init()[/font]
[font="Courier New"]{[/font]
[font="Courier New"] input.on_input += owl::app::input_delegate(&app::input_event, [color="#000080"]this);[/font]

[font="Courier New"] script = owl::script::script_ptr([color="#000080"]new owl::script::script());[/font]
[font="Courier New"] script->init();[/font]

[font="Courier New"] call_init.call();[/font]
[font="Courier New"]}[/font]

[font="Arial"]EDIT: Yap. Not even avoiding the code tags. The editor keeps duplicating new lines randomly and also ignoring tabs.[/font]

##### Share on other sites

 int main() { int a; int b; int c; } 
Thanks for the tip about RTE. I switched it off and indeed: the editor is MUCH better now.
But the code tag still looks so unbelievable ugly. I can barely see the dark blue brackets on the dark background. Seriously, even NO highlighing at all would be better. The old syntax highlighting was 100times better:/

Dark blue brackets on the dark background? The background is a light gray (?). We are not currently maintaining the black theme since we have been a white site for almost six years now. We don't have the manpower to try and keep two radically different color variations up to date.

##### Share on other sites
[source lang="cpp"]

[font="Courier New"][color="#808000"]#include "app.h"[/font]

[font="Courier New"]app::app()[/font]
[font="Courier New"]{[/font]

[font="Courier New"]}[/font]

[font="Courier New"]app::~app()[/font]
[font="Courier New"]{[/font]

[font="Courier New"]}[/font]

[font="Courier New"][color="#000080"]void app::configure()[/font]
[font="Courier New"]{[/font]
[font="Courier New"] call_configure.call();[/font]
[font="Courier New"]}[/font]

[font="Courier New"][color="#000080"]void app::init()[/font]
[font="Courier New"]{[/font]
[font="Courier New"] input.on_input += owl::app::input_delegate(&app::input_event, [color="#000080"]this);[/font]

[font="Courier New"] script = owl::script::script_ptr([color="#000080"]new owl::script::script());[/font]
[font="Courier New"] script->init();[/font]

[font="Courier New"] call_init.call();[/font]
[font="Courier New"]}

[/source]

source lang="cpp"
/source
[/font]

I wanna

##### Share on other sites

I wanna

The source tag inclusion is relatively new.. but don't omit the lang="cpp" argument as it seems to mangle the code right now. I posted about it here:
http://www.gamedev.net/blog/1037/entry-2249817-new-syntax-highlighting-in-forums-and-journals/

##### Share on other sites

[quote name='owl' timestamp='1306124470' post='4814449']
I wanna

The source tag inclusion is relatively new.. but don't omit the lang="cpp" argument as it seems to mangle the code right now. I posted about it here:
http://www.gamedev.n...s-and-journals/
[/quote]

[color="#1c2837"]
[source lang="cpp"]
void owl::render::gui::gui::input_event(const owl::app::input_event& e)
{
root->input_event(e);
}

void owl::render::gui::gui::hide_dialog()
{
root->pop_dialog();
}

void owl::render::gui::gui::show_file_dialog()
{
dialog.file->set_visible(true);
dialog.file->move( (root->get_width()-dialog.file->get_width())/2, (root->get_height()-dialog.file->get_height())/2);
}

void owl::render::gui::gui::messagebox(const std::string& text )
{
dialog.messagebox->set_visible(true);
dialog.messagebox->move( (root->get_width()-dialog.messagebox->get_width())/2, (root->get_height()-dialog.messagebox->get_height())/2);
}
[/source]

[size="7"][color="#1c2837"]EDIT: YAY!
[size="7"][color="#1c2837"]EDIT2: When I touch it, it gets broken!

##### Share on other sites
When you say broken, what happens? I did notice that sometimes on a subsequent edit is that the syntax highlighter doesn't immediately load.. but for some reason reloading the page again loads the highlighter again. I'm not sure if there is some sort of ajaxy posting thing going on when editing.

##### Share on other sites
Hmm.

[source lang="cpp"]
void Application::OnActionCommand(USHORT CommandID)
{
switch(CommandID)
{
case IDA_EXIT: PostMessage(AppHw,WM_CLOSE,0,0); break;
}
}
[/source]

[EDIT] Yay! Tabs work properly with the source and cpp tags. Thanks, Mr Tanczos. Should really keep more up to date.

[EDIT] Wait, I see what owl means. As soon as I edit a post then save the changes, the source and lang=cpp box goes back to behaving like the code box. Weird.

[EDIT] Until I refresh, then come back again. Never mind, probably a cache issue or something.

##### Share on other sites

I did notice that sometimes on a subsequent edit is that the syntax highlighter doesn't immediately load.

I think it might be related to the edit box being handled with ajax. Some way to re-run the java after edit could solve it tough.

That's a gorgeous source tag. Keep it.

##### Share on other sites

That's a gorgeous source tag. Keep it.

Agreed. All source tags should render in Consolas, or they are not teh winnar. And being now able to copy-paste direct from VS is awesome.

##### Share on other sites
I would like to propose that the existing code tag be modified so that it doesn't use it's broken syntax highlighter anymore and instead uses the new syntax highlighter like the source tag; as there is no way at present to provide an argument deciding which language to highlight with the code tag it should use the "text" (plain text) brush, giving a nice box with a mono-spaced font and scrollbar but not risking incorrect colouring.

This way people using the RTE UI would get partial benefit of the new syntax highlighter, and if I understand how the system functions posts already using the defective tag should also be improved for future viewers.

This is all of course assuming you haven't found a way to actually provide UI for the new source tag; if you can do that it would be a preferred solution, and ideally some of the other options (such as the ability to highlight some lines) should be exposed.

From what I understand there's a simple way to change the HTML output of BBCode tags, so if I'm correct this should be a very quick and simple change to make?

##### Share on other sites

I would like to propose that the existing code tag be modified so that it doesn't use it's broken syntax highlighter anymore and instead uses the new syntax highlighter like the source tag; as there is no way at present to provide an argument deciding which language to highlight with the code tag it should use the "text" (plain text) brush, giving a nice box with a mono-spaced font and scrollbar but not risking incorrect colouring.

This way people using the RTE UI would get partial benefit of the new syntax highlighter, and if I understand how the system functions posts already using the defective tag should also be improved for future viewers.

This is all of course assuming you haven't found a way to actually provide UI for the new source tag; if you can do that it would be a preferred solution, and ideally some of the other options (such as the ability to highlight some lines) should be exposed.

From what I understand there's a simple way to change the HTML output of BBCode tags, so if I'm correct this should be a very quick and simple change to make?

I had to write a custom plugin for this and it has to sort of compete with the native processing of posts as well since the syntax highlighter wants absolutely ZERO br tags in the source code and IPB wants to put br tags in. Right now the RTE for this software is also very basic in terms of what you can add on plugin wise.. Version 3.2 of IPB can't get here fast enough for me. I want tags in the forums and and the brand new RTE that includes your own personal media library that you can upload images and other files to to link from in posts. Maybe then we'll get some sophistication with the plugins we can write.. finally.

##### Share on other sites
I should imagine IPB are probably rueing the day they sold their product to you lot. Bet they've never had such demanding customers before .

##### Share on other sites

I had to write a custom plugin for this and it has to sort of compete with the native processing of posts as well since the syntax highlighter wants absolutely ZERO br tags in the source code and IPB wants to put br tags in. Right now the RTE for this software is also very basic in terms of what you can add on plugin wise.. Version 3.2 of IPB can't get here fast enough for me. I want tags in the forums and and the brand new RTE that includes your own personal media library that you can upload images and other files to to link from in posts. Maybe then we'll get some sophistication with the plugins we can write.. finally.

The "Alert" when a language wasn't found could be commented out. (or does it show only for the poster?)
Maybe if the language isn't present it could be defaulted to cpp? At least that way the format of the box can be kept and the literals will still be colored.

##### Share on other sites

I should imagine IPB are probably rueing the day they sold their product to you lot. Bet they've never had such demanding customers before .

We have submitted quite a few bug reports / suggestions.

##### Share on other sites
New code looks great. I wonder something though. Since this is a developer's forum do you think they take your suggestions with a bit more weight than other non-developer customers? Just wondering.