Page MenuHome

Add horizontal scroll bar to Text Editor
Open, NormalPublic


Currently, there is no horizontal ruler in the text editor, even though the text continues outside the visible area:

We should add a horizontal scrollbar when text exceeds the width of the editor.


Differential Revisions
D4054: Add horizontal scrollbar to the Text Editor
To Do

Event Timeline

William Reynish (billreynish) triaged this task as Normal priority.

Hey, I started on this one last weekend and I have a working version of the drawing functions - The scrollbar is correctly drawn according to line length and window size and so on.
I'll get the code to a presentable state and add mouse functionality over the next few weekends.
Just a question though:
What should the highlight be when the selection spans more than one line?
For example if "according to line length" to "I'll get the code" was selected, should there be two red line at the bottom? Should there be a red line at all?


@Amit Sari (Hamitos) Great. I think line highlighting doesn't make sense for the horizontal scrollbar - only the existing vertical one.

Hey, I have a diff ready here.
What happens now?

Hi I am a beginner and I would like to contribute towards this task. Is @Amit Sari (Hamitos) still working on it?
From what I understand is - the original problem was the overflowing of the text and no horizontal bar to access it. Wouldn't it be solved by adding "Word Wrap" feature in the Text editor and it gets adjusted to the width of the text editor?


@Himanshi Kalra (calra) ...still working on it?

Yes, and you can see that code and examine what it does, and what is further required by following the link just above your comment shown as D4054: Add horizontal scrollbar to the Text Editor.

Wouldn't it be solved by adding "Word Wrap"

We do have wordwrap as an option when text editing, and when that is on there is no need for a horizontal scrollbar. But there are many uses of the text editor where you would not want to turn wordwrapping on.

This task might be a nice one to explore by looking at the code referenced in the link and examine those same files on your computer. And if it all makes sense try to implement the changes that are requested in order for the patch to be complete even if it is ultimately done by someone else. Still a good learning exercise. But it might not be an easy one for a beginner, so don't be discouraged if you find it difficult, especially with the need to deal with multi-byte characters. There are lots of other easy things to learn with.

Cheers, Harley