Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
editorWindow.on('blur', () => {
editorEmitter.emit('blur');
ipc.callRenderer(editorWindow, 'blur');
});
editorWindow.on('focus', () => {
const disposable = this.configFile.onDidChange('activeProfileId', () => {
const newValue = this.activeProfile()
if (oldValue && newValue && oldValue.id !== newValue.id) {
oldValue = newValue
for (const window of BrowserWindow.getAllWindows()) {
ipc.callRenderer(window, 'active-profile-changed', newValue.attributes)
}
return callback(newValue)
}
})
this.callOnWindow(() => ipc.callRenderer(searchWindow, 'search-previous'))
},
const updateExportOptions = () => {
const editors = getEditors();
const exportOptions = getExportOptions();
for (const editor of editors) {
ipc.callRenderer(editor, 'export-options', exportOptions);
}
setOptions(exportOptions);
};
ipc.answerRenderer('search-next', ({query, options}) => {
ipc.callRenderer(currentTerminalWindow, 'search-next', {query, options})
})
))
ipc.answerRenderer('search-previous', ({query, options}) => {
ipc.callRenderer(currentTerminalWindow, 'search-previous', {query, options})
})
))
ipc.answerRenderer('change-setting', ({property, value}) => {
this.set(property, value)
for (const window of BrowserWindow.getAllWindows()) {
ipc.callRenderer(window, 'setting-changed', {property, value})
}
})
)
click(item, focusedWindow) {
ipc.callRenderer(focusedWindow, 'split', 'horizontal')
}
}
nodeIntegration: true
}
});
const titlebarHeight = 85;
prefsWindow.setSheetOffset(titlebarHeight);
prefsWindow.on('close', () => {
prefsWindow = null;
});
loadRoute(prefsWindow, 'preferences');
await pEvent(prefsWindow.webContents, 'did-finish-load');
if (options) {
ipc.callRenderer(prefsWindow, 'options', options);
}
ipc.callRenderer(prefsWindow, 'mount');
return new Promise(resolve => {
ipc.answerRenderer('preferences-ready', () => {
prefsWindow.show();
resolve(prefsWindow);
});
});
};
const openConfig = async () => {
const prefsWindow = await openPrefsWindow();
ipc.callRenderer(prefsWindow, 'open-plugin-config', name);
};