@@ -213,6 +213,7 @@ import { AddWorktreeDialog } from './worktrees/add-worktree-dialog'
213213import { RenameWorktreeDialog } from './worktrees/rename-worktree-dialog'
214214import { DeleteWorktreeDialog } from './worktrees/delete-worktree-dialog'
215215import { CantDeleteWorktreeUncommittedChanges } from './worktrees/cant-delete-worktree-uncommitted-changes-dialog'
216+ import { getEditorOverrideLabel } from '../models/editor-override'
216217
217218const MinuteInMilliseconds = 1000 * 60
218219const HourInMilliseconds = MinuteInMilliseconds * 60
@@ -1395,7 +1396,14 @@ export class App extends React.Component<IAppProps, IAppState> {
13951396 * Gets a label string for the currently selected external editor, or
13961397 * `undefined` if the user has selected a custom editor.
13971398 */
1398- private get externalEditorLabel ( ) {
1399+ private getExternalEditorLabel ( repo : Repository | CloningRepository ) {
1400+ if ( repo instanceof Repository && repo . customEditorOverride ) {
1401+ return getEditorOverrideLabel ( repo . customEditorOverride )
1402+ }
1403+ return this . defaultExternalEditorLabel
1404+ }
1405+
1406+ private get defaultExternalEditorLabel ( ) {
13991407 return this . state . useCustomEditor
14001408 ? undefined
14011409 : this . state . selectedExternalEditor ?? undefined
@@ -3119,7 +3127,7 @@ export class App extends React.Component<IAppProps, IAppState> {
31193127 onOpenInShell = { this . openInShell }
31203128 onShowRepository = { this . showRepository }
31213129 onOpenInExternalEditor = { this . openInExternalEditor }
3122- externalEditorLabel = { this . externalEditorLabel }
3130+ externalEditorLabel = { this . defaultExternalEditorLabel }
31233131 shellLabel = { useCustomShell ? undefined : selectedShell }
31243132 dispatcher = { this . props . dispatcher }
31253133 showBranchNameInRepoList = { this . state . showBranchNameInRepoList }
@@ -3346,7 +3354,7 @@ export class App extends React.Component<IAppProps, IAppState> {
33463354 onOpenInExternalEditor : this . openInExternalEditor ,
33473355 askForConfirmationOnRemoveRepository :
33483356 this . state . askForConfirmationOnRepositoryRemoval ,
3349- externalEditorLabel : this . externalEditorLabel ,
3357+ externalEditorLabel : this . getExternalEditorLabel ( repository ) ,
33503358 onChangeRepositoryAlias : onChangeRepositoryAlias ,
33513359 onRemoveRepositoryAlias : onRemoveRepositoryAlias ,
33523360 onChangeRepositoryGroupName : onChangeRepositoryGroupName ,
@@ -3753,7 +3761,9 @@ export class App extends React.Component<IAppProps, IAppState> {
37533761 isExternalEditorAvailable = {
37543762 state . useCustomEditor || state . selectedExternalEditor !== null
37553763 }
3756- externalEditorLabel = { this . externalEditorLabel }
3764+ externalEditorLabel = { this . getExternalEditorLabel (
3765+ selectedState . repository
3766+ ) }
37573767 resolvedExternalEditor = { state . resolvedExternalEditor }
37583768 onOpenInExternalEditor = { this . onOpenInExternalEditor }
37593769 appMenu = { state . appMenuState [ 0 ] }
0 commit comments