none
Code blocks in posts - line wrap

    General discussion

  • Hi

    Any chance of making code blocks line wrap? It is totally impossible to read /check code which overruns the page width and, in a long post, having to scroll down/ back up to see code continuation.


    Regards Les, Livingston, Scotland


    • Edited by leshay Friday, February 22, 2013 5:09 PM
    Friday, February 22, 2013 2:02 PM

All replies

  • I noticed the same problem in Visual C# forum. 

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    Friday, February 22, 2013 5:24 PM
    Moderator
  • Any chance of making code blocks line wrap?


    Try using the Edit frame's HTML button to remove the PRE tags?
    Saturday, February 23, 2013 8:18 PM
  • Hi

    If I did not make the post, then I don't have access to edit the post. In any case, that really isn't the answer. What is needed is MS to make the code block line wrap to the code block limits. Anything else is just a work around.

    This is the one and only forum I use where such plainly obvious glitches are left for what must be thousands if not tens of thousands of users to 'make do' with.

    Is it so hard to put this right?


    Regards Les, Livingston, Scotland


    • Edited by leshay Saturday, February 23, 2013 10:17 PM
    Saturday, February 23, 2013 10:16 PM
  • Hi leshay,

    Until now——

    Suggest you using VS's Add-In: Productivity Power Tools

    For 2012:http://visualstudiogallery.msdn.microsoft.com/3a96a4dc-ba9c-4589-92c5-640e07332afd

    (If you are using 2010, u can also find here:http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef?SRC=Home)

    This will let you copy codes in Html formation according ur VS's design;)

    Something like:

    using System;
    using System.IO;
    using System.Runtime.Serialization.Formatters.Binary;
     
    namespace CSharp
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Hello World!");
            }
        }
    }

    帮助一起改进论坛质量?提交你的意见于此。
    我的博客园
    慈善点击,点击此处
    和谐拯救危机,全集下载,净化人心

    Sunday, February 24, 2013 7:13 AM
  • Hi

    I do not have any issue with copy/paste of code blocks from the forums, only when browsing the forum is the issue prevalent. If the code block has long lines of code and has many lines, then to view the code, of the forum post, it is necessary to scroll to the bottom of the code and scroll to the right and then scroll back up toi where you were to see the line(s) continuation.  Of oourse, when doing this, it is a little hit or miss as when scrolling back up as you have lost view of the start of the code lines then.

    All in all, just the poorest way to try and cope with code, and in reality, the worst forum for ease of use I have ever used.


    Regards Les, Livingston, Scotland


    • Edited by leshay Sunday, February 24, 2013 12:25 PM
    Sunday, February 24, 2013 12:25 PM
  • If the code block has long lines of code and has many lines, then to view the code, of the forum post, it is necessary to scroll to the bottom of the code and scroll to the right and then scroll back up toi where you were to see the line(s) continuation.

    Got an example of anything that extreme?   FWIW I suspect your orientation problem could be avoided by using Middleclick for its AutoScroll feature.    Otherwise I imagine that an IE user may be able to press F7 (e.g. to toggle on its Caret Browsing mode) and scroll sideways that way.  In any case, whenever I get E-mail which has this problem I simply start a reply (without an addressee) and reformat the original to make it more readable.  I imagine this could be possible with your example too.  Etc.

    The main point of code insertion is not so much to make samples readable in a browser as it is to preserve their functionality and structure when they are imported back into the tool they originally came from.  So perhaps you could also do that--import them back into the intended environment and then use whatever features the original tool provides for making them more readable?  Etc.

     
    HTH
    Robert
    ---

    Sunday, February 24, 2013 4:26 PM
  • Hi

    I accept that it is possible for many work arounds to allow free browsing of the code blocks. However, is line wrapping so hard to cater for? Especially as it was already done in earlier versions of the forum and was broken (along with other aspects) when one of the latest versions of the forum was introduced.

    You say that it is not the intention to make code readable on the forum!  That, to my way of thinking is crazy, and if it is the case, then why bother showing the code at all - it would have been simpler to have just had attachments with nothing other than an icon to display that there was an attachment.

    As for an example.  Any post with along code block (which does have long code lines) will show the issue (in my case anyway)



    Regards Les, Livingston, Scotland



    • Edited by leshay Sunday, February 24, 2013 5:15 PM
    Sunday, February 24, 2013 5:06 PM
  • This was complained about several months ago. It is a feature of the third party tool used for code blocks. The designers decided it was better to not word wrap and add the scroll bar, because word wrapping would make the code "wrong" if copied as it appears.

    I and many others disagree, but I don't think the feature will change. I personally use the HTML editor for most of the code I post, but have noticed how difficult it is to read other's scripts if they have long lines and many lines. Sometimes I copy and paste the code into a text file so I can read it.


    Richard Mueller - MVP Directory Services

    Friday, March 1, 2013 3:14 PM
  • If it is thought that it is better to not wrap the code, then ... 

    Why make the box so small ?????????

    Look what it look like on my screen .... Cant this box get wider ??? I see a lot of room for that



    Sunday, March 10, 2013 1:22 PM
  • The amount of horizontal space available in the forums is another complaint that has been raised. This issue has been brought up.


    Richard Mueller - MVP Directory Services

    Monday, March 11, 2013 12:36 AM
  • Crazypennie,

    Use IE9 or higher version of IE.


    If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer

    Help by clicking:
    Click here to donate your rice to the poor
    Click to Donate
    Click to feed Dogs & Cats

    Monday, March 11, 2013 1:39 AM
  • Brought up, ... Yes 

    Fixed .. No,

    That will soon be a year that we cannot read the code posted without copying it back somewhere else.

    Can't be so hard to fix a formatting problem ?

    Monday, March 11, 2013 1:42 AM
  • If the forum can offer a div-style popup when clicking individual posts' header to display a post in full width, the problem would have been partially solved.

    Tuesday, March 12, 2013 5:49 AM
  • Hi

    If that means open a new tab or page with full page display then that would be ideal.


    Regards Les, Livingston, Scotland

    Tuesday, March 12, 2013 6:25 AM