File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ const _ = require('lodash');
55const alt = require ( '../alt' ) ;
66const { clearOutput, output } = require ( '../actions/console' ) ;
77
8+ const TAB_WIDTH = 8 ;
9+
810class ConsoleStore {
911 constructor ( ) {
1012
@@ -18,7 +20,7 @@ class ConsoleStore {
1820 length : 0 ,
1921 lines : [ '' ] ,
2022 lineWrap : 256 ,
21- maxLines : 2048 ,
23+ maxLines : 256 ,
2224 pointerLine : 0 ,
2325 pointerColumn : 0 ,
2426 refreshDelayMillis : 64 ,
@@ -133,6 +135,14 @@ class ConsoleStore {
133135 } ) ;
134136 }
135137
138+ tab ( ) {
139+ const { pointerColumn } = this . state ;
140+ const tabColumn = Math . floor ( pointerColumn / TAB_WIDTH ) ;
141+ this . setState ( {
142+ pointerColumn : ( tabColumn + 1 ) * TAB_WIDTH
143+ } ) ;
144+ }
145+
136146 processEvent ( evt ) {
137147 const { pointerLine, pointerColumn } = this . state ;
138148 switch ( evt . type ) {
@@ -178,6 +188,9 @@ class ConsoleStore {
178188 case 'clear-below' :
179189 this . clearBelow ( ) ;
180190 break ;
191+ case 'tab' :
192+ this . tab ( ) ;
193+ break ;
181194 default :
182195 console . log ( 'Not yet implemented:' , evt ) ;
183196 break ;
You can’t perform that action at this time.
0 commit comments