Results 1 to 7 of 7
- 12-17-2011, 07:11 PM #1
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
-
Re: lines truncated in code formatting
I think that this is a constraint (feature?) of the forum software, and so you probably can't change this by futzing with some setting.
-----
But on the other hand, if your line is that long, shouldn't it be broken up anyway if just for readability if not to also conform with Java coding standards?
- 12-17-2011, 08:21 PM #3
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
Re: lines truncated in code formatting
The problem occurs when I try to READ posts. I can fix the posts I write; but fixing those I read is another story. I've only read a dozen posts and the problem occurred in at least two of them.
-
Re: lines truncated in code formatting
If you copy the code and paste it into a basic word processor, code editor (i.e., Notepad++), or IDE, you'll see that the truncated lines still exist and can be seen and manipulated. I know that it's a kludge, but until there's a better solution, I think that this is the best option we've got.
- 12-18-2011, 11:01 PM #5
Re: lines truncated in code formatting
Try your browser's zoom out (CTRL -). Making the font smaller makes more of the text viewable.
- 12-19-2011, 12:07 AM #6
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Re: lines truncated in code formatting
I can make the code wrap by putting the following line
into the file %APPDATA%\Mozilla\Firefox\Profiles\<some string>.default\chrome\userContent.cssJava Code:.syntaxhighlighter .line {white-space: normal !important;}
The file didn't exist: I had to put it there based on the example .css which was in that folder. Following a restart FF displayed an oversized code post with wrapping.
I have never had to mess with the browser's stylesheet before, but I imagine something similar can be done with other browsers. In fact I use Chrome mostly, but FF had more easily found instructions about how to do this. Someone cleverer than me could probably come up with a version that is site specific, but I'm guessing ".syntaxhighlighter .line" won't be encountered much. And if it is it will be syntax highlighted code where I *want* normal wrapping behaviour.
- 12-19-2011, 06:13 PM #7
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
Re: lines truncated in code formatting
After too many restarts of Firefox:
Using zoom-out makes the hidden trailing text visible, but, alas, unreadably small. Besides the goal should not be to fix me. Rather, it is preferable to solve the problem for all users by fixing the interaction between syntaxhighlighter and the code that decides to justify the text to a short line width. (When a post is short, justification is avaoided and the syntax highlighter does not truncate lines.)
The Chrome/CSS hack worked a little. Lines were truncated, but a trailing end was on the overflow line. The trailing end did NOT include all the truncated text. And when lines wrapped, the line numbers got out of sync.
I was once able to change the background color with css (for .syntaxhighlighter .line.alt1). But then this stopped working.
I appreciate the responders efforts to solve the problem for me, but I am not the only user.
Similar Threads
-
Code formatting Issue
By camickr in forum Suggestions & FeedbackReplies: 21Last Post: 10-08-2011, 04:19 PM -
Formatting Java Code
By DoubleDee in forum Advanced JavaReplies: 5Last Post: 09-18-2010, 10:33 PM -
Need help formatting output and some code
By A5i19 in forum New To JavaReplies: 6Last Post: 11-09-2009, 04:58 AM -
Unify these 3 lines of code
By ulykidjoe in forum Advanced JavaReplies: 4Last Post: 07-13-2007, 01:15 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks