diff --git a/client/components/splitPane/splitPane.jsx b/client/components/splitPane/splitPane.jsx index 4c77d81a5..4e100638f 100644 --- a/client/components/splitPane/splitPane.jsx +++ b/client/components/splitPane/splitPane.jsx @@ -86,7 +86,7 @@ const SplitPane = (props)=>{ return (
- + {props.children[0]} {renderDivider} @@ -102,7 +102,7 @@ const Pane = ({ width, children, isDragging, moveBrew, moveSource, liveScroll, s return (
- {React.cloneElement(children, { moveBrew, moveSource, liveScroll, setMoveArrows })} + {React.cloneElement(children, { moveBrew, moveSource, liveScroll, isDragging, setMoveArrows })}
); }; diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 8d331e46e..4a7b9be08 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -100,6 +100,16 @@ const Editor = createClass({ if(prevProps.moveSource !== this.props.moveSource) this.sourceJump(); + if((prevProps.isDragging !== this.props.isDragging) && (this.props.isDragging) && (this.lastCursor == undefined)) { + this.lastCursor = this.codeEditor.current.codeMirror.getCursor(); + } + + if((prevProps.isDragging !== this.props.isDragging) && (!this.props.isDragging)) { + this.codeEditor.current.codeMirror.scrollTo(null, this.codeEditor.current.codeMirror.heightAtLine(this.lastCursor.line, 'local', true)) + this.codeEditor.current.setCursorPosition(this.lastCursor.line, this.lastCursor.ch); + this.lastCursor = undefined; + } + if(this.props.liveScroll) { if(prevProps.currentBrewRendererPageNum !== this.props.currentBrewRendererPageNum) { this.sourceJump(this.props.currentBrewRendererPageNum, false);