Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## #671 Horizontal scrollbar missing in editor

None
wont-fix
nobody
None
1
2015-03-30
2013-01-06
Mast B.
No

The horizontal scrollbar is missing in the editor in the stable v2.5.1. I have the editor set to do hard line wraps at 79 chars. I have one line with no spaces, so it goes out of the 79 chars on the same line. Resizing the window to fit only about 80 chars, there is no horizontal scroll bar to reach the end of that long line.

I attached a screenshot.

1 Attachments

## Discussion

• Tim Hoffmann
2013-01-06

This is not easy to fix. Essentially you are forcing the editor to work outside its specification.

As a workaround, you can temporarily switch to soft wrapping or no wrapping modes.

• Mast B.
2013-01-06

I'm not sure what you mean by forcing the editor to work outside its specification ... I didn't do anything outrageous or abnormal (or forbidden operation). It is actually a very common situation for all editors that use wrapping on word boundaries. They all display a horizontal scrollbar when a line without spaces is longer than the wrap limit (i.e. can't be wrapped), or they choose to wrap it on other chars like "/" or "-". This is actually the first editor I see that has a problem in this scenario.

I'm very interested in a fix, either scrollbar or wrap on other chars (see above). You could choose to wrap on "{" or "}" which are usual in Tex and likely to exist in long lines without spaces.

The workarounds are not really an option (I prefer making the window larger than switching off wrapping or using soft-wrap).

• Tim Hoffmann
2013-01-07

The thing is that in hard wrap mode the editor component assumes a fixed width (marked by the line). You can see that by changing the width. No matter if the actual text is smaller or wider than that, scrollbars appear/disapper when changing the available width below/above that limit. This may be regarded as a design flaw of the editor component we are using (QCodeEdit), but we have to live with that. Well, you could rewrite it, but you would have to dig into the width-calculating and line breaking code, which is not a piece of cake. Given development time is limited, I think there are more useful things to do.

So we cannot easily change the scrollbar. What about wrapping at certain chars? This may modify the meaning. Hard wrap introduces a newline, which acts as a space. Consider

\textit{sometext}\textbf{sometext}\textit{sometext}\textbf{sometext}\textit{sometext}


Hard-wrap it anywhere and it changes. It's practically impossible for the editor to decide if the intoduction of a newline is safe, except for the case of already existing spaces. In contrast, you as a user can decide that (with knowledge or by trying). So it is maybe not the worst idea to already introduce the newline yourself in this special case.

Anyway, there'd been a discussion on how the editor should behave if a line is longer than the limit and contains no spaces (https://sourceforge.net/p/texstudio/feature-requests/303/). It's not conclusive, but you are welcome to state your opinion.

Last edit: Tim Hoffmann 2013-01-07

• Mast B.
2013-01-07

Well, for now my blunt opinion is that QCodeEdit is rather dumb and the devs need a nudge to fix this and add scrollbars. I must have used editors not based on QCodeEdit because none of them had this problem.

My non-blunt opinion is that, since you're dealing with Tex, you can add a "%" in front of any "\" or "{" or after "," etc found in the line and hard-wrap there. That won't break anything in Tex but will be able to wrap long lines without spaces. Yes, it affects the Tex code, but hard-wrapping would affect it anyway ...

Last edit: Mast B. 2013-01-07

• Tim Hoffmann
2013-01-07

Ok, I have not been right with my previous statement. It seems, that hard line wrapping is not natively supported in QCE but was added some time ago in TeXstudio. Still that doesn't make it easier to fix.

Thanks for the suggestion with "%" this should work. (Even though, I'd rather have the scrollbar fixed.)

• Mast B.
2013-01-07

Looking forward to it :)

• fixed in repository, though hard line wrap is simply stupid as here, it would mean to add a CR in the middle of the file name

• status: open --> fixed
• Group: -->

• Tim Hoffmann
2015-03-30

Correction: This is not fixed.

Changing status to "wont-fix" because I don't see a realistic chance of fixing this in the future.

• status: fixed --> wont-fix

Last edit: Tim Hoffmann 2015-03-30