MCPcopy
hub / github.com/Eugeny/tabby / constructor

Method constructor

tabby-core/src/components/appRoot.component.ts:80–187  ·  view source on GitHub ↗
(
        private hotkeys: HotkeysService,
        private commands: CommandService,
        public updater: UpdaterService,
        public hostWindow: HostWindowService,
        public hostApp: HostAppService,
        public config: ConfigService,
        public app: AppService,
        platform: PlatformService,
        log: LogService,
        ngbModal: NgbModal,
        _themes: ThemesService,
    )

Source from the content-addressed store, hash-verified

78 private logger: Logger
79
80 constructor (
81 private hotkeys: HotkeysService,
82 private commands: CommandService,
83 public updater: UpdaterService,
84 public hostWindow: HostWindowService,
85 public hostApp: HostAppService,
86 public config: ConfigService,
87 public app: AppService,
88 platform: PlatformService,
89 log: LogService,
90 ngbModal: NgbModal,
91 _themes: ThemesService,
92 ) {
93 // document.querySelector('app-root')?.remove()
94 this.logger = log.create('main')
95 this.logger.info('v', platform.getAppVersion())
96
97 this.hotkeys.hotkey$.subscribe((hotkey: string) => {
98 if (hotkey.startsWith('tab-')) {
99 const index = parseInt(hotkey.split('-')[1])
100 if (index <= this.app.tabs.length) {
101 this.app.selectTab(this.app.tabs[index - 1])
102 }
103 }
104 if (this.app.activeTab) {
105 if (hotkey === 'close-tab') {
106 this.app.closeTab(this.app.activeTab, true)
107 }
108 if (hotkey === 'toggle-last-tab') {
109 this.app.toggleLastTab()
110 }
111 if (hotkey === 'next-tab') {
112 this.app.nextTab()
113 }
114 if (hotkey === 'previous-tab') {
115 this.app.previousTab()
116 }
117 if (hotkey === 'move-tab-left') {
118 this.app.moveSelectedTabLeft()
119 }
120 if (hotkey === 'move-tab-right') {
121 this.app.moveSelectedTabRight()
122 }
123 if (hotkey === 'duplicate-tab') {
124 this.app.duplicateTab(this.app.activeTab)
125 }
126 if (hotkey === 'restart-tab') {
127 this.app.duplicateTab(this.app.activeTab)
128 this.app.closeTab(this.app.activeTab, true)
129 }
130 if (hotkey === 'explode-tab' && this.app.activeTab instanceof SplitTabComponent) {
131 this.app.explodeTab(this.app.activeTab)
132 }
133 if (hotkey === 'combine-tabs' && this.app.activeTab instanceof SplitTabComponent) {
134 this.app.combineTabsInto(this.app.activeTab)
135 }
136 }
137 if (hotkey === 'reopen-tab') {

Callers

nothing calls this directly

Calls 15

getToolbarButtonsMethod · 0.95
infoMethod · 0.80
selectTabMethod · 0.80
closeTabMethod · 0.80
toggleLastTabMethod · 0.80
nextTabMethod · 0.80
previousTabMethod · 0.80
moveSelectedTabLeftMethod · 0.80
moveSelectedTabRightMethod · 0.80
duplicateTabMethod · 0.80
explodeTabMethod · 0.80
combineTabsIntoMethod · 0.80

Tested by

no test coverage detected