@@ -58,6 +58,7 @@ define(function (require, exports, module) {
5858 encodingSelect , // this is a DropdownButton instance
5959 tasksSelect , // this is a DropdownButton instance
6060 $cursorInfo ,
61+ $statusInfo ,
6162 $fileInfo ,
6263 $indentType ,
6364 $indentAuto ,
@@ -106,13 +107,17 @@ define(function (require, exports, module) {
106107 encodingSelect . $button . text ( doc . file . _encoding ) ;
107108 }
108109
110+ function _getLineCountStr ( editor ) {
111+ const lines = editor . lineCount ( ) ;
112+ return _formatCountable ( lines , Strings . STATUSBAR_LINE_COUNT_SINGULAR , Strings . STATUSBAR_LINE_COUNT_PLURAL ) ;
113+ }
114+
109115 /**
110116 * Update file information
111117 * @param {Editor } editor Current editor
112118 */
113119 function _updateFileInfo ( editor ) {
114- var lines = editor . lineCount ( ) ;
115- $fileInfo . text ( _formatCountable ( lines , Strings . STATUSBAR_LINE_COUNT_SINGULAR , Strings . STATUSBAR_LINE_COUNT_PLURAL ) ) ;
120+ $fileInfo . text ( _getLineCountStr ( editor ) ) ;
116121 }
117122
118123 /**
@@ -185,12 +190,15 @@ define(function (require, exports, module) {
185190 editor = editor || EditorManager . getActiveEditor ( ) ;
186191
187192 // compute columns, account for tab size
188- var cursor = editor . getCursorPos ( true ) ;
193+ const cursor = editor . getCursorPos ( true ) ;
189194
190- var cursorStr = StringUtils . format ( Strings . STATUSBAR_CURSOR_POSITION , cursor . line + 1 , cursor . ch + 1 ) ;
195+ let cursorStr = StringUtils . format ( Strings . STATUSBAR_CURSOR_POSITION , cursor . line + 1 , cursor . ch + 1 ) ;
196+ let cursorStrShort = StringUtils . format (
197+ Strings . STATUSBAR_CURSOR_POSITION_SHORT , cursor . line + 1 , cursor . ch + 1 ) ;
191198
192- var sels = editor . getSelections ( ) ,
193- selStr = "" ;
199+ let sels = editor . getSelections ( ) ,
200+ selStr = "" ,
201+ shortSelStr = "" ;
194202
195203 if ( sels . length > 1 ) {
196204 //Send analytics data for multicursor use
@@ -200,20 +208,28 @@ define(function (require, exports, module) {
200208 "usage"
201209 ) ;
202210 selStr = StringUtils . format ( Strings . STATUSBAR_SELECTION_MULTIPLE , sels . length ) ;
211+ shortSelStr = StringUtils . format ( Strings . STATUSBAR_SELECTION_MULTIPLE_SHORT , sels . length ) ;
203212 } else if ( editor . hasSelection ( ) ) {
204- var sel = sels [ 0 ] ;
213+ const sel = sels [ 0 ] ;
205214 if ( sel . start . line !== sel . end . line ) {
206- var lines = sel . end . line - sel . start . line + 1 ;
215+ let lines = sel . end . line - sel . start . line + 1 ;
207216 if ( sel . end . ch === 0 ) {
208217 lines -- ; // end line is exclusive if ch is 0, inclusive otherwise
209218 }
210- selStr = _formatCountable ( lines , Strings . STATUSBAR_SELECTION_LINE_SINGULAR , Strings . STATUSBAR_SELECTION_LINE_PLURAL ) ;
219+ selStr = _formatCountable ( lines , Strings . STATUSBAR_SELECTION_LINE_SINGULAR ,
220+ Strings . STATUSBAR_SELECTION_LINE_PLURAL ) ;
221+ shortSelStr = StringUtils . format ( Strings . STATUSBAR_SELECTION_SHORT , lines ) ;
211222 } else {
212- var cols = editor . getColOffset ( sel . end ) - editor . getColOffset ( sel . start ) ; // end ch is exclusive always
213- selStr = _formatCountable ( cols , Strings . STATUSBAR_SELECTION_CH_SINGULAR , Strings . STATUSBAR_SELECTION_CH_PLURAL ) ;
223+ // end ch is exclusive always
224+ const cols = editor . getColOffset ( sel . end ) - editor . getColOffset ( sel . start ) ;
225+ selStr = _formatCountable ( cols , Strings . STATUSBAR_SELECTION_CH_SINGULAR ,
226+ Strings . STATUSBAR_SELECTION_CH_PLURAL ) ;
227+ shortSelStr = StringUtils . format ( Strings . STATUSBAR_SELECTION_SHORT , cols ) ;
214228 }
215229 }
216- $cursorInfo . text ( cursorStr + selStr ) ;
230+ $cursorInfo . text ( cursorStrShort + shortSelStr ) ;
231+ $statusInfo . attr ( "title" , cursorStr + selStr + " " + _getLineCountStr ( editor ) + "\n" +
232+ Strings . STATUSBAR_CURSOR_GOTO ) ;
217233 }
218234
219235 /**
@@ -392,13 +408,20 @@ define(function (require, exports, module) {
392408 function _init ( ) {
393409
394410 $cursorInfo = $ ( "#status-cursor" ) ;
411+ $statusInfo = $ ( "#status-info" ) ;
395412 $fileInfo = $ ( "#status-file" ) ;
396413 $indentType = $ ( "#indent-type" ) ;
397414 $indentAuto = $ ( "#indent-auto" ) ;
398415 $indentWidthLabel = $ ( "#indent-width-label" ) ;
399416 $indentWidthInput = $ ( "#indent-width-input" ) ;
400417 $statusOverwrite = $ ( "#status-overwrite" ) ;
401418
419+ $statusInfo . click ( ( event ) => {
420+ event . preventDefault ( ) ;
421+ event . stopPropagation ( ) ;
422+ CommandManager . execute ( Commands . NAVIGATE_GOTO_LINE ) ;
423+ } ) ;
424+
402425 languageSelect = new DropdownButton . DropdownButton ( "" , [ ] , function ( item , index ) {
403426 var document = EditorManager . getActiveEditor ( ) . document ,
404427 defaultLang = LanguageManager . getLanguageForPath ( document . file . fullPath , true ) ;
0 commit comments