You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
It would be nice to see the gutter floating on the left of the page so that it's visible even if/when you scroll horizontally.
I have no suggestions how this could be done just now but it would definitely be a nice feature. However, I have done a little investigation and saw that this may not be so simple as the gutter itself is a table column and one that is generated within shCore.js so might involve a feature request for the SyntaxHighlighter project.
I've experimented a little bit in case you wanted to implement this yourself (if at all) and found that the following CSS change works well but requires some JavaScript changes too;
shCore.css
.syntaxhighlightertable {
table-layout: fixed !important; /* Ensures content is kept within page width (incl. scroll bars) */
}
.syntaxhighlightertabletd.code .container {
overflow: auto !important; /* Ensures scroll bar is displayed only when needed */padding-bottom:1px!important; /* Stops hanging letters being clipped by scroll bar (may need increased) */
}
Unfortunately, the downside of this is that some JavaScript will need to be called after content_script.js:64 as well as any time the window is resized. This JavaScript will be responsible for ensuring .syntaxhighlighter table td.gutter has width: Npx !important where N is equal to the width of its last child div. Otherwise, the gutter won't appear at all as table-layout: fixed calculates the layout based on the column widths and not that of their contents. How this script looks I'll leave up to you.
The text was updated successfully, but these errors were encountered:
I agree that this would be a cool feature. I can't really commit to working on it right now though. Please feel free to submit a pull request if you get the urge to try and make it happen
It would be nice to see the gutter floating on the left of the page so that it's visible even if/when you scroll horizontally.
I have no suggestions how this could be done just now but it would definitely be a nice feature. However, I have done a little investigation and saw that this may not be so simple as the gutter itself is a table column and one that is generated within shCore.js so might involve a feature request for the SyntaxHighlighter project.
I've experimented a little bit in case you wanted to implement this yourself (if at all) and found that the following CSS change works well but requires some JavaScript changes too;
shCore.css
Unfortunately, the downside of this is that some JavaScript will need to be called after content_script.js:64 as well as any time the window is resized. This JavaScript will be responsible for ensuring
.syntaxhighlighter table td.gutter
haswidth: Npx !important
where N is equal to the width of its last childdiv
. Otherwise, the gutter won't appear at all astable-layout: fixed
calculates the layout based on the column widths and not that of their contents. How this script looks I'll leave up to you.The text was updated successfully, but these errors were encountered: