@@ -22,8 +22,8 @@ const nextMode = mode => {
22
22
// Matchers for retrieving config JSON from terminal
23
23
// Remove ANSI escape code sequences. Visualization: https://goo.gl/IY8vuU
24
24
const ansiEscapeCodes = / [ \u001b \u009b ] [ [ ( ) # ; ? ] * (?: [ 0 - 9 ] { 1 , 4 } (?: ; [ 0 - 9 ] { 0 , 4 } ) * ) ? [ 0 - 9 A - O R Z c f - n q r y = > < ] / gm
25
- // Match hyperlayout config string and ignore lints. Visualization: https://goo.gl/hxz4S1
26
- const configMatcher = / (?: .| \s ) * \[ h y p e r l a y o u t c o n f i g \ ]: ( (?: .| \s ) * } ) (?: .| \s ) * / gm
25
+ // Match hyperlayout config string and ignore lints. Visualization: https://goo.gl/afYmAO
26
+ const configMatcher = / (?: .| \s ) * \[ h y p e r l a y o u t c o n f i g ] :( (?: .| \s ) * } ) (?: .| \s ) * / gm
27
27
// Cross-os new-line characters. Visualization: https://goo.gl/q501uy
28
28
const newlines = / [ \n \r ] / gm
29
29
@@ -159,14 +159,14 @@ function focusUid({dispatch}, uid) {
159
159
160
160
// Listens for cli commands and sessions
161
161
exports . middleware = store => next => action => {
162
- const { type, data} = action
162
+ let { type, data} = action
163
163
const { sessions} = store . getState ( )
164
164
const { activeUid} = sessions
165
165
166
166
// Check for hyperlayout config
167
167
if ( type === 'SESSION_ADD_DATA' ) {
168
168
data = data . replace ( ansiEscapeCodes , '' )
169
- const testedData = configMatcher . exec ( data . trim ( ) ) ;
169
+ const testedData = configMatcher . exec ( data . trim ( ) )
170
170
if ( testedData && testedData [ 1 ] ) {
171
171
const config = JSON . parse ( testedData [ 1 ] . replace ( newlines , '' ) )
172
172
hyperlayout = new Hyperlayout ( config , store )
0 commit comments