Page 1 of 1

[Solved] Multiline code in the [code] window

Posted: Wed Jul 27, 2022 4:22 pm
by charlie.it
Hi everyone, how do you see the multiline code in this forum? I see it like this in macOS 10.13.6 and Firefox or Safari, but there are three lines:
https://forum.openoffice.org/en/forum/v ... 51#p526751

Re: Multiline code

Posted: Wed Jul 27, 2022 5:41 pm
by MrProgrammer
charlie.it wrote: Wed Jul 27, 2022 4:22 pm how do you see the multiline code in this forum?
I use [pre] [/pre] tags:

SELECT
   (SELECT COUNT( "Gender" ) AS "F" FROM "R_GenderF") As "F",
   (SELECT COUNT( "Gender" ) AS "M" FROM "R_GenderM") AS "M" 
FROM
   (SELECT COUNT( "Gender" ) AS "F" FROM "R_GenderF"),
   (SELECT COUNT( "Gender" ) AS "M" FROM "R_GenderM")

What I type
What I type
202207271037.png (70.04 KiB) Viewed 4063 times
What I see with [pre]
What I see with [pre]
202207271040.png (79.85 KiB) Viewed 4063 times

But I can also use the [code] [/code] tags for multiline code. In your post, I see a single line in your code box. I don't have that problem when I use the code feature on MacOS and Safari.

Code: Select all

SELECT
   (SELECT COUNT( "Gender" ) AS "F" FROM "R_GenderF") As "F",
   (SELECT COUNT( "Gender" ) AS "M" FROM "R_GenderM") AS "M" 
FROM
   (SELECT COUNT( "Gender" ) AS "F" FROM "R_GenderF"),
   (SELECT COUNT( "Gender" ) AS "M" FROM "R_GenderM")
What I see with [code]
What I see with [code]
202207271110.png (56.21 KiB) Viewed 4057 times
charlie.it wrote: Wed Jul 27, 2022 4:22 pm but there are three lines:
Explain why you believe there are three lines. I see only one.

Re: Multiline code

Posted: Wed Jul 27, 2022 8:43 pm
by Hagar Delest
MrProgrammer wrote: Wed Jul 27, 2022 5:41 pmIn your post, I see a single line in your code box.
+1 (on my xubuntu machine with Firefox). Thus, it doesn't seem strange for me.

Re: Multiline code

Posted: Wed Jul 27, 2022 9:17 pm
by charlie.it
Sorry I expressed myself badly (my English! :oops: ), I meant that a part of the code remains hidden on the right side instead of being all visible.
Is it a problem of my browsers?

Re: Multiline code

Posted: Thu Jul 28, 2022 8:44 am
by Hagar Delest
Don't remember on my xubuntu machine but on my Windows 10 machine this morning, I see the horizontal slider with Brave:
Slider.png
Slider.png (4.42 KiB) Viewed 4004 times

Re: Multiline code

Posted: Thu Jul 28, 2022 9:06 am
by robleyd
With Safari on iOS (iPad) there is no scroll bar, until you drag the contents. On Waterfox (Linux), the scroll bar appears as expected

Re: Multiline code

Posted: Thu Jul 28, 2022 3:57 pm
by MrProgrammer
Safari 14.1.2 on MacOS 10.14.6 also shows a scroll bar for your code window.
Screen capture from the Count Request Fail post
Screen capture from the Count Request Fail post
202207280838.png (92.93 KiB) Viewed 3975 times

charlie.it wrote: Wed Jul 27, 2022 4:22 pm there are three lines:
When I use pre tags, I am telling the editor that I have preformatted the text so leave it alone. Use a monospace font, do not suppress multiple spaces, do not left-justify by removing leading spaces, and do not wrap it at word boundaries. Since the text isn't word wrapped automatically, it is my responsibility to ensure that the lines are short enough so the content can be viewed as desired. I hardly ever use code tags but I believe this indicates that the editor should use a monospace font and is never allowed to wrap the text, thus it's best to keep the lines short, as I did with the code window in my previous post by adding NewLines as needed. When you add NewLines, the code window will provide a multiline display. But your code window does (for me) provide a horizontal scrollbar so I can view long lines. I have modified your subject line for the topic to clarify that you are asking about the code window.

robleyd wrote: Thu Jul 28, 2022 9:06 am With Safari on iOS (iPad) there is no scroll bar, until you drag the contents.
iPads have relatively small screens. So Apple likes to hide scroll bars unless on them because they use valuable screen real estate. There may be a Setting which helps one control this behavior. If not, I understand that Apple just wants to keep the user interface simple, since that is what most customers need.

Re: Multiline code in the [code] window

Posted: Thu Jul 28, 2022 8:36 pm
by Hagar Delest
On my xubuntu machine with Firefox, the slider appears only when the mouse hovers the area.