File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -146,20 +146,20 @@ function registerEditorWatcher() {
146146 } ) ) ;
147147
148148 disposable . add ( editor . onDidDestroy ( ( deletedEditor ) => {
149- const editors : ( TextEditor | null ) [ ] = [ ...nova . workspace . textEditors ] ;
149+ // TODO: remember what this copy is for
150+ const editors = [ ...nova . workspace . textEditors ] ;
150151
151152 // remove one editor whose URI is the same as this editor's
152- const index = ( editors as TextEditor [ ] ) . findIndex ( ( editor ) =>
153- editor . document . uri == deletedEditor . document . uri
153+ const index = ( editors as TextEditor [ ] ) . findIndex (
154+ ( editor ) => editor . document . uri === deletedEditor . document . uri ,
154155 ) ;
155- editors [ index ] = null ;
156- const remainingEditors = editors . filter ( ( editor ) =>
157- editor !== null
158- ) as TextEditor [ ] ;
159- const remainingDocuments = remainingEditors . map ( ( editor ) =>
160- editor . document
156+ const remainingEditors = editors . filter (
157+ ( _editor , editorIndex ) => editorIndex !== index ,
161158 ) ;
162159
160+ const remainingDocuments = remainingEditors . map (
161+ ( editor ) => editor . document ,
162+ ) ;
163163 checkFeatureAvailability ( remainingDocuments ) ;
164164 } ) ) ;
165165 } ) ,
You can’t perform that action at this time.
0 commit comments