mirror of
https://github.com/desktop/desktop
synced 2024-09-17 23:21:55 +00:00
Merge pull request #4532 from johnelliott/master
Add MacVim as a supported external editor for macOS
This commit is contained in:
commit
171bf55ea0
|
@ -5,6 +5,7 @@ import { assertNever } from '../fatal-error'
|
|||
|
||||
export enum ExternalEditor {
|
||||
Atom = 'Atom',
|
||||
MacVim = 'MacVim',
|
||||
VisualStudioCode = 'Visual Studio Code',
|
||||
VisualStudioCodeInsiders = 'Visual Studio Code (Insiders)',
|
||||
SublimeText = 'Sublime Text',
|
||||
|
@ -18,6 +19,9 @@ export function parse(label: string): ExternalEditor | null {
|
|||
if (label === ExternalEditor.Atom) {
|
||||
return ExternalEditor.Atom
|
||||
}
|
||||
if (label === ExternalEditor.MacVim) {
|
||||
return ExternalEditor.MacVim
|
||||
}
|
||||
if (label === ExternalEditor.VisualStudioCode) {
|
||||
return ExternalEditor.VisualStudioCode
|
||||
}
|
||||
|
@ -51,6 +55,8 @@ function getBundleIdentifiers(editor: ExternalEditor): ReadonlyArray<string> {
|
|||
switch (editor) {
|
||||
case ExternalEditor.Atom:
|
||||
return ['com.github.atom']
|
||||
case ExternalEditor.MacVim:
|
||||
return ['org.vim.MacVim']
|
||||
case ExternalEditor.VisualStudioCode:
|
||||
return ['com.microsoft.VSCode']
|
||||
case ExternalEditor.VisualStudioCodeInsiders:
|
||||
|
@ -87,6 +93,8 @@ function getExecutableShim(
|
|||
'bin',
|
||||
'code'
|
||||
)
|
||||
case ExternalEditor.MacVim:
|
||||
return Path.join(installPath, 'Contents', 'MacOS', 'MacVim')
|
||||
case ExternalEditor.SublimeText:
|
||||
return Path.join(installPath, 'Contents', 'SharedSupport', 'bin', 'subl')
|
||||
case ExternalEditor.BBEdit:
|
||||
|
@ -133,6 +141,7 @@ export async function getAvailableEditors(): Promise<
|
|||
|
||||
const [
|
||||
atomPath,
|
||||
macVimPath,
|
||||
codePath,
|
||||
codeInsidersPath,
|
||||
sublimePath,
|
||||
|
@ -142,6 +151,7 @@ export async function getAvailableEditors(): Promise<
|
|||
textMatePath,
|
||||
] = await Promise.all([
|
||||
findApplication(ExternalEditor.Atom),
|
||||
findApplication(ExternalEditor.MacVim),
|
||||
findApplication(ExternalEditor.VisualStudioCode),
|
||||
findApplication(ExternalEditor.VisualStudioCodeInsiders),
|
||||
findApplication(ExternalEditor.SublimeText),
|
||||
|
@ -155,6 +165,10 @@ export async function getAvailableEditors(): Promise<
|
|||
results.push({ editor: ExternalEditor.Atom, path: atomPath })
|
||||
}
|
||||
|
||||
if (macVimPath) {
|
||||
results.push({ editor: ExternalEditor.MacVim, path: macVimPath })
|
||||
}
|
||||
|
||||
if (codePath) {
|
||||
results.push({ editor: ExternalEditor.VisualStudioCode, path: codePath })
|
||||
}
|
||||
|
|
|
@ -205,6 +205,7 @@ The source for the editor integration on macOS is found in
|
|||
These editors are currently supported:
|
||||
|
||||
- [Atom](https://atom.io/)
|
||||
- [MacVim](https://macvim-dev.github.io/macvim/)
|
||||
- [Visual Studio Code](https://code.visualstudio.com/) - both stable and Insiders channel
|
||||
- [Sublime Text](https://www.sublimetext.com/)
|
||||
- [BBEdit](http://www.barebones.com/products/bbedit/)
|
||||
|
@ -218,6 +219,7 @@ These are defined in an enum at the top of the file:
|
|||
|
||||
export enum ExternalEditor {
|
||||
Atom = 'Atom',
|
||||
MacVim = 'MacVim',
|
||||
VisualStudioCode = 'Visual Studio Code',
|
||||
VisualStudioCodeInsiders = 'Visual Studio Code (Insiders)',
|
||||
SublimeText = 'Sublime Text',
|
||||
|
|
Loading…
Reference in a new issue