@@ -60,7 +60,7 @@ function parseFile(file) {
6060 }
6161}
6262
63- let _childProcess = null
63+ let currentChildProcess = null
6464
6565function launchEditor ( file , specifiedEditor , onErrorCallback ) {
6666 const parsed = parseFile ( file )
@@ -105,11 +105,11 @@ function launchEditor(file, specifiedEditor, onErrorCallback) {
105105 args . push ( fileName )
106106 }
107107
108- if ( _childProcess && isTerminalEditor ( editor ) ) {
108+ if ( currentChildProcess && isTerminalEditor ( editor ) ) {
109109 // There's an existing editor process already and it's attached
110110 // to the terminal, so go kill it. Otherwise two separate editor
111111 // instances attach to the stdin/stdout which gets confusing.
112- _childProcess . kill ( 'SIGKILL' )
112+ currentChildProcess . kill ( 'SIGKILL' )
113113 }
114114
115115 if ( process . platform === 'win32' ) {
@@ -156,22 +156,22 @@ function launchEditor(file, specifiedEditor, onErrorCallback) {
156156 }
157157 const launchCommand = [ editor , ...args . map ( escapeCmdArgs ) ] . map ( doubleQuoteIfNeeded ) . join ( ' ' )
158158
159- _childProcess = childProcess . exec ( launchCommand , {
159+ currentChildProcess = childProcess . exec ( launchCommand , {
160160 stdio : 'inherit' ,
161161 shell : true ,
162162 } )
163163 } else {
164- _childProcess = childProcess . spawn ( editor , args , { stdio : 'inherit' } )
164+ currentChildProcess = childProcess . spawn ( editor , args , { stdio : 'inherit' } )
165165 }
166- _childProcess . on ( 'exit' , function ( errorCode ) {
167- _childProcess = null
166+ currentChildProcess . on ( 'exit' , function ( errorCode ) {
167+ currentChildProcess = null
168168
169169 if ( errorCode ) {
170170 onErrorCallback ( fileName , '(code ' + errorCode + ')' )
171171 }
172172 } )
173173
174- _childProcess . on ( 'error' , function ( error ) {
174+ currentChildProcess . on ( 'error' , function ( error ) {
175175 let { code, message } = error
176176 if ( 'ENOENT' === code ) {
177177 message = `${ message } ('${ editor } ' command does not exist in 'PATH')`
0 commit comments