Please add an optional vertical ruler to the IDE code editor

Feedback Case Number:
https://tracker.xojo.com/xojoinc/xojo/-/issues/73066

I raised this two years ago but there’s been no activity.

If anyone else thinks this would be a nice simple addition to the IDE, please could you give it a thumbs up? It would make my daily coding just a little bit nicer.

@Paul_Lefebvre: Any chance this could get added to your “should be an easy win” list of features? :slight_smile:

I note that even a Xojo employee (@Ricardo_Cruz) has given it a thumbs up!

4 Likes

For those a little lost at the description like I was, this is the “Page guide at [90] characters” feature in BBEdit.

I find it useful when I have a series of long lines that I’m trying to break at roughly the same spot.

3 Likes

Setting Window Size to 132 characters width in TextEdit:

Yeah - the title of that feature request is completely misleading, and the description doesn’t do a lot to refine it. A vertical ruler in the text editor context means line numbers. I had to read that request several times to understand what is being described.

That said, I’m not sure what the “official” phrase for that thing is. A line length guide, perhaps. It doesn’t actually do anything, but it tells you where a certain boundary is – often where the line wrap will happen during printing. Here’s how I would describe it:

Title: “Optional line length guide in code editor”

Description: “Add an optional line length guide to the code editor. This would be a light gray vertical line that can be placed at a certain width from the left hand edge of the editor, extending the entire height of the view – either an arbitrary distance, or the length of a certain number of characters in the code editor if the code editor font is a monospaced font. This gives the user a visual indication of how long each line of code is, for users who prefer to keep their lines below a certain length. It is a visual indicator only and would not enforce any code length restrictions.”

1 Like

I would understand it in a way, that the code is soft wrapped, too. No? Without it would not help much on smaller displays? Not sure i like this.

No, this is just a visual aid to suggest when to line break. Soft-wrap text is a separate feature.

1 Like

That’s why it is optional. :slight_smile: I wouldn’t have any use for it myself, but someone will.

1 Like

Gave the issue a :+1:

My use case is when I have to write lengthy comments. This screenshot comes from the Web SDK examples:

Everything is fun and jokes, until you want to do the same on different methods and ensure all of them will have the same comment line size. It isn’t super important, but if you care about these things… you won’t be able to just pick a random length on every method :sweat_smile:

It’s important also when you want to enforce some coding styling on a team.

8 Likes

There’s an argument here for functionality that singles out comments and wraps them to the current code editor width.

3 Likes

Thank you for explaining better what I was trying to articulate!

Amazing to see it’s been added to the next release milestone - thanks @Paul_Lefebvre!

Don’t forget that you can press SHIFT-RETURN on a comment line and it’ll start another comment on the next row!

11 Likes

I did not know that. Every day a new lesson. Thanks.

1 Like

A vertical ruler in a code editor sounded like a new way to measure programmer productivity by the “code-inch”…. “I had a great day at work today, I generated 27 code-inches.” :wink:

3 Likes

I submitted a somewhat related request to display the current line and column number in the IDE status bar (much like other IDEs and text editors do). This way you can see the current line number you are on even if you do not have the gutter line numbers turned on. Also, you can see what character you are on so it will help you limit your code lines to your desired number of characters (similar to the visual page guide). I feel this would make a very nice and simple enhancement to the IDE. If anyone is interested here is the feedback item:

https://tracker.xojo.com/xojoinc/xojo/-/issues/80316

1 Like

I would rather say “I’m beat, I generated 2.25 code feet”:grin:

1 Like

Isn’t it already the case; look at the settings:

Show line numbers in gutter is the CheckBox to change (I do not want the lines number).

Can you explain what you mean by “column number” ?

Column number is the current character you are on. Line number would be the current line you are on. See the Xcode IDE screenshot, you will see it shows line and column number on the bottom right: https://developer.apple.com/xcode/images/xcode-15-hero-large_2x.webp

That will allow you to see exactly where you are in the code without needing any additional visual aids

Did you checked the CheckBox in Settings to get the line numbers ?

Thank you for the explanation.

I do not understand the use of a Colum number, but like said a manager: if you do not use it, you can throw it away. So if you do not have the use, don’t use it. That is what I’ve done with the lines number.

Where I am in the code ? I do not remember, so I read to know where I am :wink: (memory troubles)

I stopped using line number the day I stopped to use BASIC AppleSoft :wink:

That sounds way more useful than just having a visual margin.