File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
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
@@ -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