File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -139,14 +139,17 @@ export default {
139139 showFileInfo ( url ) ;
140140 } ,
141141 async goto ( ) {
142- const res = await prompt ( strings [ "enter line number" ] , "" , "number" , {
142+ const lastLine = editorManager . editor ?. state ?. doc ?. lines ;
143+ const message = lastLine
144+ ? `${ strings [ "enter line number" ] } (1..${ lastLine } )`
145+ : strings [ "enter line number" ] ;
146+ const res = await prompt ( message , "" , "number" , {
143147 placeholder : "line.column" ,
144148 } ) ;
145149
146150 if ( ! res ) return ;
147151 const [ lineStr , colStr ] = String ( res ) . split ( "." ) ;
148- const { editor } = editorManager ;
149- editor . gotoLine ( lineStr , colStr ) ;
152+ editorManager . editor . gotoLine ( lineStr , colStr ) ;
150153 } ,
151154 async "new-file" ( ) {
152155 let filename = await prompt ( strings [ "enter file name" ] , "" , "filename" , {
You can’t perform that action at this time.
0 commit comments