Jump to content

[Fixed] Board Issue: very wide Code box


Recommended Posts

This question is prompted by the following post:

https://forums.lunarsoft.net/index.php?s=&showtopic=2807&view=findpost&p=21465

Is there any way that the Code box can be made narrower before the horizontal scrollbar kicks in?

I found the above post quite difficult to read on the 1024 wide (laptop) and 1280 wide (non-widescreen desktop) monitors I use around here, because the whole post (not just the Code box) expands way past my screen edges.

-

Link to comment
Share on other sites

  • Administrator

I can try to find a fix but it happens on all IP.Board forums, including the official forums. Hopefully it'll be fixed in IP.Board 3 which will be out soon.

I have posted in the support section for a resolution since I haven't found anything as of yet.

Link to comment
Share on other sites

  • Administrator

This comes from a guide to change the behavior of the codebox bbcode.

Note: This is in no way a bug. The codebox tag is intended to work this way. The codebox preserves linebreaks as they are entered, in the event that you have a piece of code that entering a linebreak in the wrong place would cause the code to no longer function. You are, of course, welcome to use this modification, however, it removes intended functionality from your forum.
Link to comment
Share on other sites

Thanks for the reply. I wasn't asking that all lines be wrapped, because I fully understand that the purpose of the CODEBOX is to not introduce linebreaks.

For very long lines, however, the CODEBOX introduces a horizontal scrollbar as well as a vertical scrollbar (as can be seen in the post I quoted, above). It's just that the board software doesn't add this horizontal scrollbar until the CODEBOX is something like 1600 pixels wide. Since this changes the width of the whole post, it makes the whole post difficult to read, on laptops or anything else with a non-widescreen monitor. For me, a scrollbar appearing after about 800-1000 pixels would be much nicer. I'm not saying that this is a bug, just that it's an inconvenience or a little awkward.

Anyway, it seems from your reply that I'm asking for a feature request in the next version of IP.Board rather that a quick-fix to the BBCode. It looks like this is a change to the .php code itself. So thanks for following this up.

.

Link to comment
Share on other sites

  • Administrator

From what I could tell it was a CSS change and also a change to the template code for the Codebox BBCode. I've told them what I wanted to do so maybe there will be a small correction.

I'll keep my eye on it.

Link to comment
Share on other sites

  • 3 weeks later...

Thanks for continuing to follow-up on this subject.

I know I asked for it to be smaller, but a code box two lines high by 22 characters wide is not quite what I had in mind! But I get the point -- if the size of the box can now be adjusted, then this allows for it to go right down to the size needed for a mobile (=cell phone).

Hm, wonder why it's not making scrollboxes.
Is that because it is only two lines high. In other words is the code smart enough to not try drawing a scrollbar when it won't fit? If the boxes are, say 5 lines high, does the vertical scrollbar then appear? Maybe this is because it is still alpha.
Link to comment
Share on other sites

  • 7 months later...

So I see....

Checking on the link I posted (first post) it's certainly a big improvement.

However, another bug has surfaced. If you look at the 4th line down to the penultimate line of the codebox, you'll see that there is something wrong with the font colours caused, I think, by the single quote marks. The colour changes from black to green at the first quote mark (line 4) and stays the same until the quote mark on the penultimate line. Is this some kind of smart highlighting that's confused by quote marks?

Link to comment
Share on other sites

  • Administrator

Is this some kind of smart highlighting that's confused by quote marks?

That is exactly it.

Quoting the devs:

It uses syntax highlighting


<strong>Some HTML</strong>
<?php
class some_class
{
public function some_function($foo, $bar)
{
echo 'look at all the colours!';
}
}
?>

It tries to guess the type of code you've written, so if you use the codebox for something that's not really code, then it might seem like it's highlighting random words.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...