Jump to content

  • Log In with Google      Sign In   
  • Create Account


TERRIBLE code editor/tags


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
22 replies to this topic

#1 schupf   Members   -  Reputation: 216

Posted 22 May 2011 - 10:55 AM

Hello,

I love this site but I absolutely hate the code editor. I am sorry, but its really the worst edtior/tag I have ever seen on any site.

1) When I paste formated code in the code tabs the formation is gone. I have to reformat ever single line. Extremely annoying.

2) Selection of multiple lines does not work. I wanted to select (per mouse) multiple lines of code but after some lines the selection just stops.

3) The rendering is really fucked up. I formatted ever single line by hand and it was perfectly aligned in the preview. Bu when I submit everything is fucked up and not aligned!

4) The code view with the black background and the colorful words is just plain ugly. Feels like a unix console from 1980. Why not just a syntax highlighting like visual studio?




Sorry for the criticism, but I am really pissed off right now. I spend 10 minutes to format just some lines of code and it still looks like shit. All other sites are know have nice and good looking editor/tags. Btw: I am using Opera 10.

I can't believe I am the only one who thinks the code tags are terrible...






Sponsor:

#2 Wooh   Members   -  Reputation: 595

Posted 22 May 2011 - 11:09 AM

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.

#3 Nanoha   Members   -  Reputation: 296

Posted 22 May 2011 - 11:28 AM

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.

#4 Aardvajk   Crossbones+   -  Reputation: 5866

Posted 22 May 2011 - 11:52 AM

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. :)

#5 schupf   Members   -  Reputation: 216

Posted 22 May 2011 - 12:04 PM

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:/

#6 Aardvajk   Crossbones+   -  Reputation: 5866

Posted 22 May 2011 - 12:09 PM

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.

#7 schupf   Members   -  Reputation: 216

Posted 22 May 2011 - 01:08 PM


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.

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.

#8 owl   Banned   -  Reputation: 364

Posted 22 May 2011 - 01:29 PM

#include "app.h"

app::app()
{

}

app::~app()
{

}

void app::configure()
{
call_configure.call();
}

void app::init()
{
input.on_input += owl::app::input_delegate(&app::input_event, this);

// Load script
script = owl::script::script_ptr(new owl::script::script());
script->init();
script->load("lua_main.lua");

call_init.call();
}

EDIT: Yap. Not even avoiding the code tags. The editor keeps duplicating new lines randomly and also ignoring tabs.
I like the Walrus best.

#9 Michael Tanczos   Senior Staff   -  Reputation: 5166

Posted 22 May 2011 - 10:12 PM

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.

#10 Michael Tanczos   Senior Staff   -  Reputation: 5166

Posted 22 May 2011 - 10:15 PM

[source lang="cpp"][font="Courier New"][color="#808000"]#include "app.h"[/color][/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"][b][color="#000080"]void[/color][/b] app::configure()[/font][font="Courier New"]{[/font][font="Courier New"] call_configure.call();[/font][font="Courier New"]}[/font] [font="Courier New"][b][color="#000080"]void[/color][/b] app::init()[/font][font="Courier New"]{[/font][font="Courier New"] input.on_input += owl::app::input_delegate(&app::input_event, [b][color="#000080"]this[/color][/b]);[/font] [font="Courier New"] [color="#808080"]// Load script[/color][/font][font="Courier New"] script = owl::script::script_ptr([b][color="#000080"]new [/color][/b]owl::script::script());[/font][font="Courier New"] script->init();[/font][font="Courier New"] script->load([color="#000080"]"lua_main.lua"[/color]);[/font] [font="Courier New"] call_init.call();[/font][font="Courier New"]}[/source]

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

#11 owl   Banned   -  Reputation: 364

Posted 22 May 2011 - 10:21 PM

I wanna
I like the Walrus best.

#12 Michael Tanczos   Senior Staff   -  Reputation: 5166

Posted 22 May 2011 - 10:25 PM

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/

#13 owl   Banned   -  Reputation: 364

Posted 22 May 2011 - 10:43 PM


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/



[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(){ root->add_dialog(dialog.file); 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 ){ root->add_dialog(dialog.messagebox); 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]


EDIT: YAY!
EDIT2: When I touch it, it gets broken! Posted Image
I like the Walrus best.

#14 Michael Tanczos   Senior Staff   -  Reputation: 5166

Posted 23 May 2011 - 05:17 AM

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.

#15 Aardvajk   Crossbones+   -  Reputation: 5866

Posted 23 May 2011 - 05:33 AM

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.

#16 owl   Banned   -  Reputation: 364

Posted 23 May 2011 - 01:48 PM

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.
I like the Walrus best.

#17 Aardvajk   Crossbones+   -  Reputation: 5866

Posted 23 May 2011 - 02:42 PM

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.

#18 jbadams   Senior Staff   -  Reputation: 17779

Posted 24 May 2011 - 03:04 AM

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?

#19 Michael Tanczos   Senior Staff   -  Reputation: 5166

Posted 24 May 2011 - 06:07 AM

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.

#20 Aardvajk   Crossbones+   -  Reputation: 5866

Posted 24 May 2011 - 08:32 AM

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 :).




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS