@@ -12,6 +12,7 @@ const consoleStore = require('../console-store');
12
12
const Terminal = require ( '../lib/terminal' ) ;
13
13
const Documents = require ( '../lib/documents' ) ;
14
14
const highlighter = require ( '../lib/highlighter' ) ;
15
+ const directive = require ( '../lib/directive' ) ;
15
16
16
17
const {
17
18
NEW_FILE ,
@@ -102,11 +103,14 @@ function handlers(app, opts, done){
102
103
return ;
103
104
}
104
105
105
- workspace . newFile ( builtName , '' )
106
+ const insertDirective = directive ( 'BS2' , 2.5 ) ;
107
+
108
+ workspace . newFile ( builtName , insertDirective )
106
109
. then ( ( ) => userConfig . set ( 'last-file' , builtName ) )
107
110
. then ( function ( ) {
108
- documents . create ( path . join ( cwd , builtName ) , '' ) ;
111
+ documents . create ( path . join ( cwd , builtName ) , insertDirective ) ;
109
112
documents . focus ( ) ;
113
+ goDocEnd ( ) ;
110
114
} ) ;
111
115
}
112
116
@@ -296,6 +300,10 @@ function handlers(app, opts, done){
296
300
cm . execCommand ( 'replace' ) ;
297
301
}
298
302
303
+ function goDocEnd ( ) {
304
+ cm . execCommand ( 'goDocEnd' ) ;
305
+ }
306
+
299
307
function moveByScrollUpLine ( ) {
300
308
const scrollbox = cm . getScrollInfo ( ) ;
301
309
cm . scrollTo ( null , scrollbox . top - cm . defaultTextHeight ( ) ) ;
0 commit comments