File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -786,10 +786,18 @@ function checkEditorStyle() {
786786 if ( scrollbarStyle == 'overlay' || currentMode == modeType . both ) {
787787 ui . area . codemirrorScroll . css ( 'height' , desireHeight + 'px' ) ;
788788 ui . area . codemirrorScroll . css ( 'min-height' , '' ) ;
789+ // workaround simple scroll bar knob
790+ // will get wrong position when editor height changed
791+ var scrollInfo = editor . getScrollInfo ( ) ;
792+ preventSyncScroll = true ;
793+ editor . scrollTo ( null , scrollInfo . top - 1 ) ;
794+ editor . scrollTo ( null , scrollInfo . top ) ;
789795 } else if ( scrollbarStyle == 'native' ) {
790796 ui . area . codemirrorScroll . css ( 'height' , '' ) ;
791797 ui . area . codemirrorScroll . css ( 'min-height' , desireHeight + 'px' ) ;
792798 }
799+ // workaround editor will have wrong doc height when editor height changed
800+ editor . setSize ( null , ui . area . edit . height ( ) ) ;
793801 //make editor resizable
794802 ui . area . edit . resizable ( {
795803 handles : 'e' ,
You can’t perform that action at this time.
0 commit comments