Source viewer doesn't always wrap source code correctly, sometimes hiding code



8 years ago
3 years ago


(Reporter: jorgev, Assigned: andy+bugzilla)




(Whiteboard: [ReviewTeam], URL)


(1 attachment)



8 years ago
In the included URL, if I select file chrome/content/ietabSetting1.js you should be able to see line 28 being wrapped because it's too long. However, it's also cropped.

The line is

gConsole: Components.classes[";1"].getService(Components.interfaces.nsIConsoleService),

However, at least on my browser I don't see the last 5 characters in that line, and several other lines below. If the lines can't be reliably wrapped, then there should be some indication that there's more code to be seen. A scrollbar works.

Comment 1

8 years ago
Actually, there is a scrollbar, but it's so far to the bottom of the page that I didn't know it was there. The problem remains, though, there's no clear indication that I can scroll to the side in these cases, and ideally the source should be always wrapped to avoid any scrolling.
We shouldn't be messing with scrollbars and stuff - if it's wrapped it should be wrapped.

Is this a bug with the JS or CSS?
Assignee: nobody → amckay

Comment 3

8 years ago
Using word-wrap: break-word which generally gets it close. I can set to not wrapped at by default.

Comment 4

8 years ago
Set to unwrapped by default, I still think its a useful option so left the option to wrap there.
Last Resolved: 8 years ago
Resolution: --- → FIXED

Comment 5

7 years ago
This doesn't fix the problem. I still need to scroll down several pages (in many cases) just to reach the scrollbar. This is not very usable at the moment.

Comment 6

7 years ago
reopening as per comment 5
Resolution: FIXED → ---
(In reply to comment #5)
> This doesn't fix the problem. I still need to scroll down several pages (in
> many cases) just to reach the scrollbar. This is not very usable at the
> moment.

Why is there a scrollbar if the text is wrapped?

Comment 8

7 years ago
Because some long lines of code do not have any white space in them. After a certain amount of text without any white space Fx does not wrap them using word-wrap: break-word.
That sounds like a pretty rare case.  Jorge - what are you picturing as a solution to this bug?

Comment 10

7 years ago
It's not so rare when we consider this is code, and not top quality code in many cases.

I see 2 possibilities:
1) Getting the line breaks right so that there's never any horizontal scrolling. That means that even lines without spaces need to break so that they don't leave the frame.
2) Have the horizontal scrollbar visible at all times. Likes most IDEs do, we can have a frame for the source viewer that always fits the screen.


7 years ago
Target Milestone: 6.1.1 → 6.1.2

Comment 11

7 years ago
Created attachment 539894 [details]

Got it wrapping nicely. Here's a pathalogical test. Big speed up on calculating line numbers too.

Comment 12

7 years ago
Back to wrapping.

Should speed things up too.
Last Resolved: 8 years ago7 years ago
Resolution: --- → FIXED
> Should speed things up too.

I think there is another bug about that

Comment 14

7 years ago
Reclassifying editor bugs and changing to a new whiteboard flag. Spam, spam, spam, spam...
Whiteboard: [required amo-editors] → [ReviewTeam]
Product: → Graveyard
You need to log in before you can comment on or make changes to this bug.