Vertical scroll bar for very long code or noformat blocks

Issue #12 resolved
Former user created an issue

Currently the plugin does not offer a vertical scrollbar, if there are plenty of lines to display. This may be intended, but may also make the description of an issue hard to read.

This may be fixed by giving a new height attribute that would go to the underlying CSS. When feeding it with height=10em this would cause a scroll-bar after ten lines of code, whereas height=120px would cause a scroll-bar after so much px. {{{ #!java {code:height=xxx} // ... // loads of code here // ... {code} }}}

Probably this is related to the issue #6

Comments (28)

  1. Mike Winston

    This feature keeps getting bumped, but it really is vital. We have long code pastes being used and the vertical scroll bar ends up off the page. So to scroll right, you need to loose your place. It would really be nice to have the ability to bound these areas.

  2. Mason Foley

    Another vote for this issue. We use this a lot with XML of REST responses in our RESTful services development. Many JIRAs become unwieldy with the entire length of the XML showing.

  3. Holger Schimanski repo owner
    • changed milestone to 2.1.0

    Sorry, I need to reschedule to version 2.1.0 due to some major changes need to be done for 2.0.0.

  4. Mike Winston

    @hski - Although collapse is a nice feature, I don't think it really handles the issue that I posted earlier. The issue I have is that the left->right scroll bar (at the bottom of the code block) is not visible unless you scroll the webpage down. This in turns makes you loose your place in the code you were looking at. It is just like not being able to freeze the top rows in Excel. If you have to scroll down, you loose the context in which you are doing the scrolling for.

  5. Holger Schimanski repo owner

    Okay, I understand you use case! I had a look at my CSS code, adding a height: 10em; to the surrounding div for example should work.

  6. Mason Foley

    I don't understand the usage of this one. How do I {code:xml} and {code:height=10em} for the same block of xml I'm attempting to highlight?

  7. Holger Schimanski repo owner

    @masonfoley To explain a little, {code} can have multiple parameter e.g. {code:xml|title=Sample XML code|linenumbers}. This issue is about to add a new parameter to set the height of the code box and by thus introducing a vertical scroll bar e.g. {code:xml|title=Sample XML code|height=5|linenumbers} meaning show 5 lines of code and a vertical scroll bar, if more than 5 lines of code is in the {code} block.

  8. Holger Schimanski repo owner

    Together with the vertical scroll bar I would like to propose a "Show more" link similar to collapse parameter to give the user the possibility to remove the height limitation and to be able to see the full code block without scrolling.

    What do you think?

  9. Holger Schimanski repo owner

    Do you think, this "Show more" link after 5 lines of code instead (!) of vertical scroll bar would be sufficient? I mean instead of a vertical scroll bar, show only first x lines of code and the a "Show more" link to expand the code block.

  10. Mason Foley

    I'd prefer to have the scroll bar. Some of our XML can have hundreds of lines of text or more. This can cause a performance issue in some scenarios if the entire code block is rendered. Also, it forces the user to scroll back to the beginning if they want to collapse it back.

  11. Mike Winston

    @hski , I agree with @mason_foley on this. Also, that would defeat my original problem which is the vertical scroll (see my previous comments for details)

  12. Holger Schimanski repo owner

    In a recent discussion on Answers I got aware, that by default JIRAs noformat and code block has a max-height: 30em;.

    I would like to implement this max-height: 30em; for JIRA Syntax Highlighter in favor to implement a parameter height.

  13. Mike Winston

    @hski , I believe this change still meets my needs and I can very much support the consistency with the original Atlassian product.

  14. Schoenhofen, Kelly Account Deactivated

    I know this is resolved, but I'm confused. I see vertical and horizontal scrollbars (empty, but framed) for even single line noformat's. How is that consistent with the original Atlassian product? Is it not possible to not have scrollbars when you don't need them?

  15. Log in to comment