You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No fallback on windows ... always fails on windows if no editor is open #96
Since it is uncommon for windows to have EDITOR or VISUAL set, I added:
( There also seems no way to prevent launch-editor from wrapping my error-callback to not log a not format matching error like the rest of my cli app ... )
importlaunchEditorXfrom'launch-editor';importopenfrom'open';functionlaunchEditor(file: string,errCb?:(file:string,errorMessage:string|null)=>void): void{functionreject(file:string,errorMessage:string|null){// log that the user needs to select an editor himselfconsole.error(colors.red(figures.warning),'Please select an editor yourself.');// just throw the file at the OS and try to let it handle it// (in this project, these will be text files, so we do not care)open(file,{wait: false});}// set the VISUAL env as default if none is available, looking at you windows// DO NOT use LAUNCH_EDITOR, since we do not always enforce notepad, just use as fallback. if(!process.env.VISUAL&&!process.env.EDITOR)process.env.VISUAL=/^win/.test(process.platform) ? "notepad" : // this is required!"vim";// VISUAL | EDITOR should not require this// try already opened editors, fall back to env VISUAL | EDITORlaunchEditorX(file,errCb??reject);}
Activity