@@ -1067,9 +1067,9 @@ define('ace/ace', ['require', 'exports', 'module' , 'pilot/index', 'pilot/plugin
10671067
10681068define ( 'pilot/index' , [ 'require' , 'exports' , 'module' , 'pilot/fixoldbrowsers' , 'pilot/types/basic' , 'pilot/types/command' , 'pilot/types/settings' , 'pilot/commands/settings' , 'pilot/commands/basic' , 'pilot/settings/canon' , 'pilot/canon' ] , function ( require , exports , module ) {
10691069
1070- require ( 'pilot/fixoldbrowsers' ) ;
1071-
10721070exports . startup = function ( data , reason ) {
1071+ require ( 'pilot/fixoldbrowsers' ) ;
1072+
10731073 require ( 'pilot/types/basic' ) . startup ( data , reason ) ;
10741074 require ( 'pilot/types/command' ) . startup ( data , reason ) ;
10751075 require ( 'pilot/types/settings' ) . startup ( data , reason ) ;
@@ -8030,7 +8030,7 @@ var EditSession = function(text, mode) {
80308030
80318031 this . $stopWorker ( ) ;
80328032
8033- if ( this . $useWorker )
8033+ if ( this . $useWorker )
80348034 this . $startWorker ( ) ;
80358035
80368036 var tokenizer = mode . getTokenizer ( ) ;
@@ -8059,19 +8059,19 @@ var EditSession = function(text, mode) {
80598059 this . $stopWorker = function ( ) {
80608060 if ( this . $worker )
80618061 this . $worker . terminate ( ) ;
8062-
8062+
80638063 this . $worker = null ;
80648064 } ;
8065-
8065+
80668066 this . $startWorker = function ( ) {
80678067 if ( typeof Worker !== "undefined" && ! require . noWorker ) {
8068- // try {
8068+ try {
80698069 this . $worker = this . $mode . createWorker ( this ) ;
8070- // } catch (e) {
8071- // console.log("Could not load worker");
8072- // console.log(e);
8073- // this.$worker = null;
8074- // }
8070+ } catch ( e ) {
8071+ console . log ( "Could not load worker" ) ;
8072+ console . log ( e ) ;
8073+ this . $worker = null ;
8074+ }
80758075 }
80768076 else
80778077 this . $worker = null ;
@@ -8577,7 +8577,7 @@ var EditSession = function(text, mode) {
85778577 removedFolds = this . getFoldsInRange ( e . data . range ) ;
85788578 this . removeFolds ( removedFolds ) ;
85798579
8580- var foldLine = this . getFoldLine ( lastRow ) ;
8580+ var foldLine = this . getFoldLine ( end . row ) ;
85818581 var idx = 0 ;
85828582 if ( foldLine ) {
85838583 foldLine . addRemoveChars ( end . row , end . column , start . column - end . column ) ;
@@ -8593,7 +8593,7 @@ var EditSession = function(text, mode) {
85938593
85948594 for ( idx ; idx < foldLines . length ; idx ++ ) {
85958595 var foldLine = foldLines [ idx ] ;
8596- if ( foldLine . start . row >= lastRow ) {
8596+ if ( foldLine . start . row >= end . row ) {
85978597 foldLine . shiftRow ( - len ) ;
85988598 }
85998599 }
@@ -8985,7 +8985,7 @@ var EditSession = function(text, mode) {
89858985 }
89868986 }
89878987 var docRowCacheLast = docRow ;
8988- // clamp row before clamping column, for selection on last line
8988+ // clamp row before clamping column, for selection on last line
89898989 var maxRow = this . getLength ( ) - 1 ;
89908990
89918991 var foldLine = this . getNextFold ( docRow ) ;
@@ -9016,7 +9016,7 @@ var EditSession = function(text, mode) {
90169016
90179017 if ( foldLine && foldLine . start . row <= docRow )
90189018 line = this . getFoldDisplayLine ( foldLine ) ;
9019- else {
9019+ else {
90209020 line = this . getLine ( docRow ) ;
90219021 foldLine = null ;
90229022 }
@@ -9163,21 +9163,29 @@ var EditSession = function(text, mode) {
91639163 } ;
91649164
91659165 this . getScreenLength = function ( ) {
9166- var length = this . getLength ( ) ;
91679166 var screenRows = 0 ;
9167+ var lastFoldLine = null ;
9168+ var foldLine = null ;
91689169 if ( ! this . $useWrapMode ) {
9169- screenRows = length ;
9170+ screenRows = this . getLength ( ) ;
9171+
9172+ // Remove the folded lines again.
9173+ var foldData = this . $foldData ;
9174+ for ( var i = 0 ; i < foldData . length ; i ++ ) {
9175+ foldLine = foldData [ i ] ;
9176+ screenRows -= foldLine . end . row - foldLine . start . row ;
9177+ }
91709178 } else {
91719179 for ( var row = 0 ; row < this . $wrapData . length ; row ++ ) {
9172- screenRows += this . $wrapData [ row ] . length + 1 ;
9180+ if ( foldLine = this . getFoldLine ( row , lastFoldLine ) ) {
9181+ row = foldLine . end . row ;
9182+ screenRows += 1 ;
9183+ } else {
9184+ screenRows += this . $wrapData [ row ] . length + 1 ;
9185+ }
91739186 }
91749187 }
91759188
9176- var foldData = this . $foldData ;
9177- for ( var i = 0 ; i < foldData . length ; i ++ ) {
9178- var foldLine = foldData [ i ] ;
9179- screenRows -= foldLine . end . row - foldLine . start . row ;
9180- }
91819189 return screenRows ;
91829190 }
91839191
@@ -14740,7 +14748,7 @@ define("text/ace/css/editor.css", [], ".ace_editor {" +
1474014748
1474114749define ( "text/styles.css" , [ ] , "html {" +
1474214750 " height: 100%;" +
14743- " width: 100%; " +
14751+ " width: 100%;" +
1474414752 " overflow: hidden;" +
1474514753 "}" +
1474614754 "" +
@@ -14764,7 +14772,7 @@ define("text/styles.css", [], "html {" +
1476414772 "#editor {" +
1476514773 " position: absolute;" +
1476614774 " top: 0px;" +
14767- " left: 300px ;" +
14775+ " left: 280px ;" +
1476814776 " bottom: 0px;" +
1476914777 " right: 0px;" +
1477014778 " background: white;" +
@@ -14784,7 +14792,7 @@ define("text/styles.css", [], "html {" +
1478414792 "" +
1478514793 "#cockpitInput {" +
1478614794 " position: absolute;" +
14787- " left: 300px ;" +
14795+ " left: 280px ;" +
1478814796 " right: 0px;" +
1478914797 " bottom: 0;" +
1479014798 "" +
0 commit comments