-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New preference to be able to scroll past the end of the file #7142
Conversation
extraKeys : codeMirrorKeyMap, | ||
autoCloseBrackets : currentOptions[CLOSE_BRACKETS], | ||
autoCloseTags : currentOptions[CLOSE_TAGS], | ||
scrollPastEnd : !range ? currentOptions[SCROLL_PAST_END] : false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flip this around so the else case is not a double-negative:
range ? false : currentOptions[SCROLL_PAST_END]
I just noticed that the vertical scrollbar goes behind the little square in bottom-right corner. Removing the |
Done with review. |
That has happened ever since we added custom scrollbars for the editor. Check this recent conversation #5083 (comment)
Do you mean that it just goes to the bottom of the file or it actually stops where it should? If is the first one, we still have a bug, since both the horizontal and vertical thumbs would overlap at that corner. |
The vertical scroll thumb is already going to the bottom of the file even when there is a horizontal scroll bar, but the The horizontal scroll thumb does not go into that corner, so there is no overlap. But, this is for another pull request -- I just thought I'd mention it. |
I actually can see the horizontal bar go beneath the vertical one. I would like if the scrollbars stop where they should. Notice that there is a min width in the thumb, so it will never be too small to not be able to grab it to scroll up. We should fill a new issue for that. Pushed the fixes for this PR. |
@@ -55,6 +55,7 @@ | |||
<script src="thirdparty/CodeMirror2/addon/edit/matchbrackets.js"></script> | |||
<script src="thirdparty/CodeMirror2/addon/edit/closebrackets.js"></script> | |||
<script src="thirdparty/CodeMirror2/addon/edit/closetag.js"></script> | |||
<script src="thirdparty/CodeMirror2/addon/scroll/scrollpastend.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeMirror v4 changed how addons are loaded, so merge to the latest master add a require()
for this.
@TomMalbran I'm ready to merge this into master, but there's 1 change you need to make. |
@redmunds Merged with master and fixed the require issue. |
@@ -1847,6 +1850,10 @@ define(function (require, exports, module) { | |||
(!useTabChar && prefName === TAB_SIZE)) { | |||
return; | |||
} | |||
// Do not apply this option to inline editors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an awkward place to check this, this seems better:
} else if (prefName === STYLE_ACTIVE_LINE) {
this._updateStyleActiveLine();
} else if (prefName === SCROLL_PAST_END && this._visibleRange) {
// Do not apply this option to inline editors
return;
} else {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that looks better. If we assign the useTabChar
var at line 1836, we could make the if at line 1849 be an else if too.
Done with review. One more comment. |
@redmunds Changes pushed. |
} else if (prefName === SCROLL_PAST_END && this._visibleRange) { | ||
// Do not apply this option to inline editors | ||
return; | ||
} else if ((useTabChar && prefName === SPACE_UNITS) || (!useTabChar && prefName === TAB_SIZE)) { | ||
// Set the CodeMirror option as long as it's not a change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to reverse the logic of this comment:
// This change conflicts with the useTabChar setting,
// so do not change the CodeMirror option
@redmunds fixed |
Looks good. Merging. |
New preference to be able to scroll past the end of the file
Woot :) Added it to https://github.com/adobe/brackets/wiki/How-to-Use-Brackets#preferences |
Since is sometimes hard to write at the bottom of the screen, this allows you to scroll past the end until the point that the last line becomes the first line in view. This can be enabled with a new preference which is disabled by default.